Skip to content

diegogaulke/go-docker-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Docker Multi-stage build example

Multi-stage build example of a Golang app.
We use multi-stage builder to build the Go app and then use the scratch image to run the generated binary.
With this strategy you get a small image size of a few MBs.

All depenencies are managed with go dep.

This example use Gin to run a http server.

Build docker image:
docker build -t go-docker-example .

Run generated image:
docker run -it -p 8080:8080 go-docker-example

Now test it: http://localhost:8080/ping

Releases

No releases published

Packages

No packages published