In this tutorial I will demonstrate how to build slim docker images using multistage docker builds, where you can save up to 800MB of disk space per image.
About We will use multistage docker builds from a alpine image as our build image to get the dependencies, build the go binary and use our scratch image to place the built binary onto our target image to have small docker images....
In this tutorial we will demonstrate how to build a container image and how to run a docker container, as well as how to persist data and exposing host ports to reach the container ports.
Assumptions I will assume that you have docker installed.
Running a Container Let’s start with the basics, running a container. To run a container, we instantiate a container instance from a container image. There are thousands of container images on a container registry such as docker hub, a example that we will be working with will be the ubuntu official image....