Skip to content

Instantly share code, notes, and snippets.

@pjlsergeant
Created June 20, 2020 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjlsergeant/3c3180d2beb98624d4561266a7166931 to your computer and use it in GitHub Desktop.
Save pjlsergeant/3c3180d2beb98624d4561266a7166931 to your computer and use it in GitHub Desktop.

adet - Drive docker, docker-compose, and aws ecs from one config

adet attempts to provide maximum DWIM for projects using docker, Docker Compose and AWS ECS from YAML configuration files. It supports the three projects I'm working on nicely, each one of which has several component Docker images organized into tasks and services, and deployed on ECS.

Synopsis

Login

Config:

version: 0.01
registry: 225802617615.dkr.ecr.eu-west-1.amazonaws.com
defaults:
  aws_profile: osc

Allows:

$ adet login https://225802617615.dkr.ecr.eu-west-1.amazonaws.com
Logging into 225802617615.dkr.ecr.eu-west-1 as osc
Login Succeeded    

Images

Config:

images:
    myImage:
        repository    : myImageB
        context       : ./imageb
        dockerfile    : ./imageb/docker.yaml
        build_requires:
            - MYENVVAR

Allows:

$ MYENVAR=foo adet images build myImageB

Or:

$ adet images pull myImageB

And:

$ adet images push myImageB

Tasks

Config:

tasks:
    myImageT:
        image: myImageB
        environment:
            - name: foobar
              value: baz1
        dev_mount:
            - ./:/opt/mycode
            - /some/path:/opt/path
    ports:
        - 3000:5000

Allows:

$ adet compose [any command docker-compose accepts]

With the addition of:

$ adet compose shell myImageT

Services

Config:

services:
    myService:
        task: myImageT
        desired: 2

Allows:

$ adet deploy_service myService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment