DEV Community

Discussion on: Multi-stage Dockerfile for Golang application

Collapse
 
lisitsky profile image
lisitsky

Can we use FROM scratch for the last step?

Collapse
 
plutov profile image
Alex Pliutau

Right, it's much better!

Collapse
 
sarbash profile image
Sergey Sarbash • Edited

Surely, I do this everyday when I have to rebuild my docker image for an app.
Just remember about a static build and You'll be alright.

CGO_ENABLED=0 GOOS=linux go build -a .

Have fun with Docker && Go! :)

Collapse
 
lisitsky profile image
lisitsky

Thank you!