Running docker image on AWS EC2

2019-08-06 16:49发布

enter image description here

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?

1条回答
【Aperson】
2楼-- · 2019-08-06 17:11

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

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

  1. Pull the image locally
  2. Create a container
  3. Start the container

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='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

You can then use docker ps to view running containers

查看更多
登录 后发表回答