Skip to content
A demo on how to build a small Docker image with Alpine and go cli tools
Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
README.md
check.sh
invalid-document.yaml
schema.yaml
valid-document.yaml

README.md

multi-stage-go

This is a demo on how to build a small Docker image with Alpine Linux and Dockers multi-stage build feature that includes go cli tools.

To build the container:

docker build -t janahrens/multi-stage-go:latest .

To use the container:

docker run -v $PWD:/root -it janahrens/multi-stage-go:latest ./check.sh schema.yaml invalid-document.yaml

Check the containers contents and size:

docker image ls janahrens/multi-stage-go:latest
docker create --name tmp_$$ janahrens/multi-stage-go:latest
docker export tmp_$$ | tar tv | sort -k5 -r | head
docker rm tmp_$$
You can’t perform that action at this time.