DevOps Classroom notes 04/Jan/2024

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
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%