How containers work
- Observations: Following are the observations from our manual executions in the class
- applications requiring software like java need not be present on the docker host (linux machine where docker is installed), They are present in container
- users on the docker host and the container are not same
- The process tree of docker host is differnt from process tree of container
- mounts in the docker host are different from mounts in container
- Refer Here for docker internals
-
In Linux we have a concept called as namespaces which allows to create
- process trees for isolated areas pid namespace
-
To access applications inside containers we might need port forwarding
- Every container created has a unique container id and container name. if you dont pass the name docker creates random names.

Activities
- Create a container running nginx
docker container run -p 32000:80 -d nginx


* Create one more container running nginx. Lets try by using same command again
docker container run -p 32000:80 -d nginx
- This fails as the 32000 port is in use. We can ask the docker to map free port on the docker host to 80 port
docker container run -P -d nginx

- Lets try to assing name to the nginx container as webapp1

