This is a beginner question but I started learning about docker and how each container is isolated from another container.
In an example in the lesson, the video said that the great thing about docker is that we can ignore dependency conflicts so if we have image A
that requires dependency A v1.0
and image B
that requires dependency A v2.0
, then it's as simple as specifying it in the docker image and we don't have to worry about conflicts about versions and whatnot.
Now my questions are:
When I run a docker container, where are those dependencies installed? If, for example, my host machine doesn't have
dependency A
, then when I run a docker container that require it, where does it install it to run the container?If it gets installed, is it isolated to that docker container only? If I wanted to use
dependency A
on my host machine, would I be able to from the installed version from the docker container or do I have to install it again on my host machine?Is the dependency installed multiple times per docker container? If I have 5 running containers of
image A
and 10 containers ofimage B
, it doesn't installdependency A v1.0
5 times anddependency A v2.0
10 times, right?