From 2fe0f3d68fcbb83a0fd35a59f936d0685630b04f Mon Sep 17 00:00:00 2001 From: Toni Hermoso Pulido Date: Mon, 9 Oct 2023 13:14:19 +0200 Subject: [PATCH] Update docker_2.rst --- docs/docker_2.rst | 52 ----------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/docs/docker_2.rst b/docs/docker_2.rst index 707e7aa..aa922ca 100644 --- a/docs/docker_2.rst +++ b/docs/docker_2.rst @@ -340,55 +340,3 @@ Build and run: -Additional commands -=================== - -* **docker inspect**: Get details from containers (both running and stopped). Things such as IPs, volumes, etc. - -* **docker logs**: Get *console* messages from running containers. Useful when using with web services. - -* **docker commit**: Turn a container into an image. It make senses to use when modifying container interactively. However this is bad for reproducibility if no steps are saved. - -Good for long-term reproducibility and for critical production environments: - - -* **docker save**: Save an image into an image tar archive. - -* **docker load**: Load an image tar archive to become an image. - -* **docker export**: Save a container filesystem into a tar archive. - -* **docker import**: Import a filesystem tar archive into an image (you need to specify a target tag). - - -Example dealing with tar images -------------------------------- - -.. code-block:: console - - # Let's save the image in a tar - docker save -o random_numbers.tar random_numbers - - # Remove the original image - docker rmi random_numbers - - # Check existing images now - docker images - - # Recover it - docker load < random_numbers.tar - - # Check now images - docker images - - -Note about the tar formats --------------------------- - -* If you check the tar archives generated thanks to **save** with the ones using export, you will notice they do not look the same. - -* The former ones ressemble more what you will find in ``/var/lib/docker`` (that is where Docker daemon stores its data) and it includes metadata information (so it is not necessary to specify an image tag). - -* On the other hand, tar files generated with **export** they simply contantain the image filesystem. You lost that way a lot of metadata associated to the original image, such as the tags, but also things such as ENTRYPOINT and CMD instructions. - -