Should I be concerned about excess, non-running, Docker containers?

前端 未结 5 1586
花落未央
花落未央 2021-01-29 23:35

Every docker run command, or every RUN command inside a Dockerfile, creates a container. If the container is no longer running it can still be seen wit

5条回答
  •  囚心锁ツ
    2021-01-30 00:38

    An image is a snapshot of file system and dependencies or a specific set of directories of a particular application/software. By snapshot I mean, a copy of just those files which are required to run that piece of software (for example mysql, redis etc.) with basic configurations in a container environment.

    When you create a container using an image, a small section of resources from your system are isolated with the help of namespacing and cgroups, and then the files inside the image are copied in this isolated environment of resources.

    Hence, containers only take disk space. If there are unused containers, you should remove them, but not the image as they always reusable.

提交回复
热议问题