davidmcclure / docker-ami

Build a base Docker AMI.

Repository from Github https://github.comdavidmcclure/docker-amiRepository from Github https://github.comdavidmcclure/docker-ami

Docker AMI

This repository automates the process of building a base Docker AMI on EC2 (Ubuntu 18.4).

Terraform is used to create the sandbox instance on EC2; then Ansible is used to install Docker and create the AMI.

Usage

  1. On the host machine, install:

  2. Run ./setup.sh, which initializes the Terraform project and installs Python dependencies.

  3. Create a terraform.tfvars file in the root directory, and provide values for the three required variables:

    vpc_id          = "vpc-XXX"
    subnet_id       = "subnet-XXX"
    public_key_path = "/path/to/key.pub"
  4. Run ./build.sh. This will create the instance, install Docker, create the AMI, and log the AMI id to the terminal in the last Ansible step.

  5. After the AMI has been created, terraform destroy is run to remove the EC2 resources - type yes to confirm.

About

Build a base Docker AMI.


Languages

Language:HCL 85.1%Language:Shell 9.9%Language:Smarty 4.9%