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
    Preview
  • Every container created has a unique container id and container name. if you dont pass the name docker creates random names.
    Preview

Activities

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

Preview
Preview
* 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

Preview

  • Lets try to assing name to the nginx container as webapp1
    Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube