Getting started with Docker

Great news!! Since v0.10 release aah framework brings support for Docker Image on Docker Hub and aah CLI command for Dockerfile generation.

aah has automated build process for Docker Image creation. Supported Docker tags are -

  • aahframework/aah:latest - Latest production release.
  • aahframework/aah:{version} - Specific release version, for e.g.: aahframework/aah:v0.9.
  • aahframework/aah:edge - Latest development edge version.


  • aah framework docker base image is golang:latest.
  • Ensure to install Docker on your machine.

Table of Contents

Pull aah Docker Image

Pull docker image from Docker Hub.

# Pull latest production release
docker pull aahframework/aah:latest

# Pull edge version
docker pull aahframework/aah:edge

# Pull specific version
docker pull aahframework/aah:v0.9

Handy generate Command

aah CLI includes generate command to help developers in their application development path. This command generates two docker files -

Note: aah CLI provides very good starter Dockerfile(s) for your application, enhance it per your need.


# run from anywhere
aah generate script --name docker --importpath

# OR if you're in app directory or path
aah generate script --name docker

# OR short form
aah g s -n docker

Using Dockerfile.*

To Build Docker Image

# Using
docker build --no-cache -t "yourapp:dev" -f .

# Using
docker build --no-cache -t "yourapp:latest" -f .

Running built Docker Image

# To run image
# To stop press Ctrl + C
docker run -it -p 8080:8080 "yourapp:dev" aah run

# To run image
# To stop, do it via container stop
docker run -p 8080:8080 "yourapp:latest"

Compile your app inside the Docker container

There might a occasions you would like to build your application inside the container and get the build artifact. You can write something like:

docker run --rm -v "$PWD":/go/src/ -w /go/src/ aahframework/aah:latest aah build