Choosing the right Docker base image
Depending on our end goal, using the image of our favorite Linux distribution might or might not be the best solution. Starting with a full CentOS container image might be a waste of resources, while an Alpine Linux image might not contain the most complete libc for our usage. In other cases, using the image from our favorite programming language might also be a good idea, or not. Let's see this in depth and learn when to choose what source.
Getting ready
To step through this recipe, you will need a working Docker installation.
How to do it…
Most common distributions are available as a container form.
Starting from an Ubuntu image
Ubuntu ships official images that are all tagged with both their release version and name: ubuntu:16.04
is equivalent to ubuntu:xenial
. At the time of writing, the supported Ubuntu releases are 12.04 (precise), 14.04 (trusty), 16.04 (xenial), and 16.10 (yakkety).
To start with an Ubuntu image in a Dockerfile, execute the following...