Skip to content
Basic docker files for a simple go application showing how to build and run go in a container.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is the source for the CodeSolid article, Building a Golang Docker Container.

The article documents it better, but briefly...

We show two ways to build and run a go application, and document the approach in README files in the two folders:

  • naive - This approach is simple but almost certainly not what you want for production. It's worth starting here if you're somewhat new to Docker files, since we go over some basic commands and techniques.
  • multistage - Here we use a multistage build to reduce the image size substantially -- from 700+ Mb down to 13, and remove the code from our final image.
You can’t perform that action at this time.