Deploying to AWS
Learn what steps are required to deploy.
We'll cover the following...
Create the manager instance
We will use the docker-machine create
command to create our first cloud instance.
docker-machine create \--driver amazonec2 \--amazonec2-open-port 80 \--amazonec2-open-port 8080 \--amazonec2-region us-east-1 \aws-manager-1
Note that we use the AWS-specific --amazonec2-open-port
option to open up the firewall to allow us to hit ports 80 (for web
) and 8080 (for visualizer
which we will add soon). To see that if it is listed, run:
$ docker-machine ls
Initialize the swarm
To initialize the swarm, you will need the internal IP address and to configure an SSH session to connect as the root user.
Internal IP address
The instance’s internal IP address can found by running:
$ docker-machine ssh aws-manager-1 "ifconfig eth0" | grep 'inet addr:'
The IP address will be listed on the second line as the inet addr
value.
Add the user to the docker group
In AWS, docker-machine
’s SSH session is not configured to connect as the root user. So with the AWS driver, we connect via SSH as the ubuntu, non-root user. In order to have permissions to run Docker ...