This asciinema describes the procedure of creating a minimal Docker image that contains commands such as bash, ssh, wget, etc. from a centos:latest Docker image. The result is that the image will have a size of only 16Mb, instead of the 362 Mb. from the original Docker image.
The asciicast content
Checking that the user can run docker containers.
Getting the centos:latest image
Creating one container and tests it (verifies that it does not have wget, nor ssh, etc.).
Building one image with wget, ssh, ip, etc. using a Dockerfile (called minicon:ex1fat).
Verify the size of the new image.
Check that the image has the new commands (run a container and issue commands).
Use minicon to create the minified image (minicon:ex1): include –apt dependencies, include example executions of the commands that we want to keep (-E ‘ping -c 1 www.google.es’).
Verify the size of the new image: 10.9Mb.
Check the new image (minicon:ex1) and see that it has the requested commands, but only these commands.