在AWS EC2上运行Docker映像 [英] Running docker image on AWS EC2

查看:227
本文介绍了在AWS EC2上运行Docker映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个项目 http://scrapoxy.readthedocs.io/安装在ec2上.我正在尝试遵循快速入门( http://scrapoxy.readthedocs.io/en/master/quick_start/index.html )我创建了一个ec2 ubuntu实例,并执行了屏幕截图中的第1步和第2步.指令不清楚,我对Docker也没有经验,但是我应该将ssh放入ec2实例并从命令行运行容器"吗?

I've come across a project http://scrapoxy.readthedocs.io/ which can be installed on ec2. I'm trying to follow the quickstart (http://scrapoxy.readthedocs.io/en/master/quick_start/index.html) I've created an ec2 ubuntu instance and performed steps 1 and 2 in the screenshot. The instructions are not clear and I'm not experienced with docker, but am I supposed to ssh into my ec2 instance and "run the container" from the command line?

推荐答案

您是正确的,您将必须通过SSH进入EC2实例.如果尚未安装Docker,则还必须安装它.您可以找到有关这里

You are correct that you will have to SSH into your EC2 instance. You are also going to have to install Docker if it is not already installed. You can find some good instructions for that here

通常,对于docker映像,您必须执行以下操作:

Typically, with docker images, you have to perform the following:

  1. 在本地拖动图像
  2. 创建一个容器
  3. 启动容器

在说明中看到的 run 命令基本上结合了这三个步骤.

The run command that you see in the instructions basically combines these 3 steps.

如果更容易理解,或者您需要在每个步骤之间进行操作,则还可以分别运行这三个步骤.通常这就是我的做法

If it's easier to understand, or you need to take action between each step, you can also run the 3 steps individually. This is typically how I do it

  1. docker pull fabienvauchelles/scrapoxy
  2. docker create --name scraproxy -e COMMANDER_PASSWORD ='CHANGE_THIS_PASSWORD'\ -e PROVIDERS_AWSEC2_ACCESSKEYID ='您的访问密钥ID'\ -e PROVIDERS_AWSEC2_SECRETACCESSKEY ='您的秘密访问密钥'\ -it -p 8888:8888 -p 8889:8889 fabienvauchelles/scrapoxy
  3. docker start scraproxy
  1. docker pull fabienvauchelles/scrapoxy
  2. docker create --name scraproxy -e COMMANDER_PASSWORD='CHANGE_THIS_PASSWORD' \ -e PROVIDERS_AWSEC2_ACCESSKEYID='YOUR ACCESS KEY ID' \ -e PROVIDERS_AWSEC2_SECRETACCESSKEY='YOUR SECRET ACCESS KEY' \ -it -p 8888:8888 -p 8889:8889 fabienvauchelles/scrapoxy
  3. docker start scraproxy

然后您可以使用 docker ps 查看正在运行的容器

You can then use docker ps to view running containers

这篇关于在AWS EC2上运行Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆