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.
Note:
- 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.
Handy generate
Command
aah CLI includes generate
command to help developers in their application development path. This command generates two
docker files -
Dockerfile.dev
- For development usage with aah docker image.Dockerfile.prod
- Using Multistage-build to create very small docker image for production purpose. More info, refer to https://docs.docker.com/develop/develop-images/multistage-build/.
Note: aah CLI provides very good starter Dockerfile(s) for your application, enhance it per your need.
Example
Using Dockerfile.*
To Build Docker Image
Running built Docker Image
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: