How does docker manage container new files

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

When running two containers from the same image, Container A,and B

Suppose that in Container A, we have installed package AA, and in container B,we have installed package BB, without using any drive.

The questions is, are containers completely stateless? as long as we are still using those containers, where are installed packages stored? would I be able to accessed package AA from container B and vice versa?

Answers

Containers are not stateless, they are stateful. Each container gets its own wholly-owned and unique overlay filesystem on top of the base image. These per-container changes (state) are isolated from each other and thus no you could not access package AA from container B. When you docker rm container-a you are just deleting container A s unique overlay, leaving the base image unchanged. This is part of the reason that docker start and docker run are different commands, run implies creating a new container and therefore a new per-container state (initially nothing other than the base image), whereas start implies "execute the container using the persisted state from when it was last stopped".

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/36110212/how-does-docker-manage-container-new-files

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils