January 2020
Intermediate to advanced
640 pages
16h 56m
English
Go comes with built-in support for producing standalone, static binaries, making it an ideal candidate for containerization! Let's take a look at the best practices for building Docker containers for your Go applications.
Since static Go binaries tend to be quite large, we must take extra steps to ensure that the containers we build do not include any of the build tools (for example, the Go compiler) that are used at build time. Unless you are using a really old version of Docker, your currently installed version will most likely support a feature known as build containers.
A build container includes all the tools that are needed for compiling our Go application: the Go compiler and the Go standard ...