- Install Docker Toolbox or
docker-machine
. - Sign up for an AWS account.
- Possibly a Docker Hub account if needed for logging in.
- Follow all the steps in configuring IAM. The most important are the following.
- Delete your root access keys
- Create individual IAM users
- Use groups to assign permissions
- Get a copy of your access and secret user keys.
- Make sure your user and/or group have access to all relevant AmazonEC2 policies (choosing all works). Ignore ECS policies as they are unneeded.
- Run
docker login
if you have a Docker Hub account. - Create a machine on AWS with
docker-machine
- Run
docker-machine create --driver amazonec2
to get a sense of relevant options that are available. - The following are required options.
- Access Key
- Secret Key
- VPC ID
- Machine name
- The following are recommended options (have defaults, but should be set).
- Instance Type
- Root Size (or Root Disk Size)
- Region (if not on the US East Coast)
- Zone (if not "a").
- Using your options create a new machine.
- Run
- Run
docker-machine start <MACHINE NAME>
if it is not already running. - Regenerate certificates
docker-machine regenerate-certs -f <MACHINE NAME>
. Could skip to 3, but return and continue from here if it suggest doing this. - Activate your environment
eval $(docker-machine env <MACHINE NAME>)
. - Now you can use
docker
remotely.
- We have mentioned AWS here, but other host services could use a similar procedure with modifications.
- Port mapping is possible by editing the inbound ports using the EC2 Dashboard and looking for "Network & Security" then "Security Group". Set the inbound ports.