Skip to content

Packer script to create an AMI to run Docker Compose applications from cloud-init

Notifications You must be signed in to change notification settings

pierredavidbelanger/cloud-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud-compose

A simple Packer script to create an Ubuntu based AMI to run Docker Compose applications from a cloud-init user-data.

EC2 tags will become environment variables (written to a .env file).

A docker login will be done if a value is found for docker.username and docker.password into EC2 Systems Manager using GetParameters.

Create the AMI

$ git clone https://github.com/pierredavidbelanger/cloud-compose
$ cd cloud-compose
$ packer build \
    -var 'aws_region=us-east-2' \
    -var 'aws_source_ami=ami-618fab04' \
    ami.json

Use the AMI

Launch an EC2 instance with the AMI created above and this user-data content:

#cloud-config
write_files:
  - path: /var/lib/cloud-compose/docker-compose.yml
    content: |
      version: '3'
      services:
        hello-world:
          image: tutum/hello-world
          restart: always
          ports:
            - 8080:80

About

Packer script to create an AMI to run Docker Compose applications from cloud-init

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages