June 2017
Intermediate to advanced
400 pages
10h 32m
English
This recipe created a script that compiles the Go binary for the Linux architecture and sets a variety of private variables in main.go. These variables are used to return version information on a version endpoint. Once the binary is compiled, a Docker container is created that contains the binary. This allows us to use very small container images as the Go runtime is self contained in the binary. We then run the container while exposing the port on which the container is listening for HTTP traffic. Lastly, we curl the port on localhost and see our version information returned.
Read now
Unlock full access