minimal ubuntu-based Docker image with bash, ssh, wget, etc. in 10.9 Mb, using minicon

by c4lf4
GNU/Linux ◆ xterm-256color ◆ bash 1596 views

This asciinema describes the procedure of creating a minimal Docker image that contains commands such as bash, ssh, wget, etc. from a ubuntu:latest Docker image. The result is that the image will have a size of only 10.9Mb, instead of the 211 Mb. from the original Docker image.

The asciicast content

  1. Checking that the user can run docker containers.
  2. Getting the ubuntu:latest image
  3. Creating one container and tests it (verifies that it does not have wget, nor ssh, etc.).
  4. Building one image with wget, ssh, ip, etc. using a Dockerfile (called minicon:ex1fat).
  5. Verify the size of the new image.
  6. Check that the image has the new commands (run a container and issue commands).
  7. 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’).
  8. Verify the size of the new image: 10.9Mb.
  9. Check the new image (minicon:ex1) and see that it has the requested commands, but only these commands.