'AWS EC2 AMI for running Docker images
I'm looking to automate the provisioning of an EC2 instance that will run docker and a specific container by default when the machine comes up. I have been using Amazon's ECS AMI, but am wondering if there's a better one out there that has Docker pre-installed. Does anyone have experience using another AMI from the marketplace?
Solution 1:[1]
I stumbled across this question while researching the same question. I haven't found any existing AMIs that come pre-configured with Docker, although I'm sure. A deeper search will find one. However, you can also create your own AMI. It isn't at all difficult and only takes a few minutes.
In short: launch an EC2 instance with your favorite flavor of Linux. Install and configure your base Jenkins, and then follow these pretty simple directions to create a custom AMI.
Solution 2:[2]
When choosing an AMI at instance launch, searching "docker" or "deep learning" will turn up deep learning AMIs that come with Docker installed.
Solution 3:[3]
the easiest option is passing the script via User data(other wise just run it manually when connecting to the instance) section while creating a new EC2 machine.
yum update -y
amazon-linux-extras install docker
service docker start
usermod -a -G docker ec2-user
chkconfig docker on
just as a note this refer to the amazon linux AMI(default), just check for the instruction of your AMI and change accordingly
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Joseph Larson |
| Solution 2 | Elan |
| Solution 3 | helpper |
