Completek8s Classroomnotes 27/Jun/2023

Docker contd

Namespaces in Linux

  • Namespaces are a feature of Linux Kernel, that partitions kernel resources such that one set of processes sees one set of resoruces in other words they isolate processes from each other
  • Types of Namespaces
    • user namespace: creates its own set of user ids and group IDS in process
    • Process (PID) namespace: Assigns a set of PIDS to process that are independent from parent process
      Preview
    • network namespace: Create its own private routing table, set of ip address etc
    • mount namespace: Creates independent list of mount points seen within process
    • IPC (interprocess communication) namespace: Creates its own IPCs
  • Namespaces are one of the technologies that containers are built on, they are used to enforce segregration of resources. Using container technologies like Docker, rkt, podman makes much easier to create namespaces on your behalf

cgroups (Control groups)

  • This is also a linux kernel feature that limmits, accounts form and isolates the resource usage (CPU,memory, disk I/O, network …)

Play with Docker CLI

  • Docker command line:
    • Use cheatsheet
    • Use help
  • Using Help
    Preview
    Preview
    Preview

Creating my first contianer

  • To create a docker container we need image or docker image
  • Docker image is a packaging format which is OCI compliant has all the necessary stuff included to run your application in container
  • Docker Hub Refer Here is a default registry which is collection of docker images. Each image is stored as repository
  • Registry is collection of docker image repository. Each repository represents some application and tag of the image represents some version
  • Lets try to run nginx Refer Here
  • What happens when we try to run a container
    Preview
    Preview
    Preview
  • Commands:

    • docker container run (create a container)
    • docker image ls (list all the local images)
    • docker container ls (running containers)
  • Every container that is created will have unique id and name. id is generated by docker, where as name is generated only when you dont pass it
    Preview
  • To interact with containers we need id or name

Docker Container states

  • Refer the below from linux Handbook
    Preview
  • Create a container and then start it
    Preview
    Preview
  • Run the container to create and start
    Preview
  • Running container can be
    • stopped
    • paused
    • deleted by using force
      Preview
      Preview
  • Stopped container can be
    • started
    • deleted
      Preview
      Preview
  • Paused container can be
    • unpaused
    • deleted
      Preview

Microservice-Design Problem

  • We have discussed about publish and subscribe (an intro)
    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
Social Media Icons Powered by Acurax Web Design 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