Deep Docker Lab

Step 1 – Register a site to POST Assigment and Share with Trainer and For Self Notes

- How to register? -
# Check Inbox SPAM box for Activation Email.
- How to login? -
- How to write post? -
- How to check your Post? -

Step 2 – Pre Test using LMS

  • Login to using any gmail account
  • Try this quiz –
  • Send a results to

Step 3 – Install Docker Engine in Centos#1 Vm.

Step 4 – Assignment#1

  • Create a Ubuntu container
    docker run -it ubuntu
    It will fetch the ubuntu docker image from docker hub and you will be connected to container in detached mode.
  • Install Update, git & apache2
    Once your inside of your Ubintu docker container, Run
    apt-get update –> It will install the latest version of packages matches the specified group of packages.
    apt-get install git –> It will install the Git package and all it’s dependency packages

root@8196a7b58778:/# git –version
git version 2.25.1

       apt-get install apache2 –> It will install the apache2 package and all it’s dependency


root@8196a7b58778:/# apache2 -v
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2021-07-05T07:16:56

  • Run a git command in container from outside

docker exec <containerId> git –version

[root@localhost ~]# docker ps -a
73a91b4435f6 httpd “httpd-foreground” 19 minutes ago Up 19 minutes>80/tcp festive_mahavira
8196a7b58778 ubuntu “bash” 48 minutes ago Exited (130) 22 seconds ago hungry_goldwasser
d1b6f4921a3e hello-world “/hello” About an hour ago Exited (0) About an hour ago epic_kirch
[root@localhost ~]# docker exec 8196a7b58778 git –version
Error response from daemon: Container 8196a7b58778f172fabd431d26a9094b022b3d9019099537b682b4586168651b is not running
[root@localhost ~]# docker start 8196a7b58778
[root@localhost ~]# docker exec 8196a7b58778 git –version
git version 2.25.1
[root@localhost ~]#

Step 5 – Assignment#2

  • Create a httpd container exposed at 80 port

    docker run -d -p 80:80 httpd
  • Access (curl) container from node

[root@localhost ~]# curl

It wors!

[root@localhost ~]#

Step 6 – Assignment#3

Find out answer for following questions
- Where is the LOCAL Registry and How do i find out???
When you run the docker info command it will provide all the info about your docker. In that info, You can find the root dir of docker where it's being installed in your base/host machine some thing like below, 
[root@localhost ~]# cd /var/lib/docker
[root@localhost docker]# ls
containers  image  network  overlay2  plugins  swarm  tmp  trust  volumes
[root@localhost docker]# cd image
[root@localhost image]# ls
[root@localhost image]# cd overlay2/
[root@localhost overlay2]# ls
distribution  imagedb  layerdb  repositories.json
[root@localhost overlay2]# cd imagedb/
[root@localhost imagedb]# ls
content  metadata
[root@localhost imagedb]# cd content/
[root@localhost content]# ls
[root@localhost content]# cd sha256/
[root@localhost sha256]# ls
bd29370f84eac6a9fa5373f8ed702f66820e784e5f680b62670af9f851017c96  c29284518f497b8c5f49933e74e43ca5221e69c8251e780427f7d12f716625ff  d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726
[root@localhost sha256]# ls -lrt
total 20
-rw-------. 1 root root 1470 Jul 21 00:41 d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726
-rw-------. 1 root root 1462 Jul 21 00:43 c29284518f497b8c5f49933e74e43ca5221e69c8251e780427f7d12f716625ff
-rw-------. 1 root root 8701 Jul 21 01:33 bd29370f84eac6a9fa5373f8ed702f66820e784e5f680b62670af9f851017c96
[root@localhost sha256]# pwd
[root@localhost sha256]#

- [OFFLINE]Git is NOT versioning a file. So what?
Git is a distributed version control system system that records different states file/files/set of files.
It lets users to access, compare, update and distribute any of the recorded version(s) at any time.

- What is diff between docker pause and docker unpuase?

docker pause - It suspends all the processes in specified containers. It pauses(i.e sends SIGSTOP) all     
               the processes in a container and also it would stall keep memory portion while container
               is pause.  This memory is used while container is resumed.
docker unpause - When docker unpassed, SIGCONT is passed to container to restore the container process.
NOTE: You couldn't able to perform any action while container is paused.

- What is significant of docker stop and docker kill?
docker stop - It stops the container gracefully(In 10sec) like how shutting down your laptop instead of
              forcefully shutting down. It will send SIGTERM(terminate) to the process and docker will
              have 10 sec to cleanup like files or other stuff.
docker kill - It will kill a container(sends SIGKILL). The main process inside the container will be sent
              SIGKILL to kill a container forcefully. 

- Create an image with base - centos and git must be installed in it.

We can do it using dockerfile in automation process and reusable also.Below is the sample docker file
which will have centos an base image along with Git is installed in it,

FROM centos:latest

MAINTAINER Kishore Katreddy

RUN yum -y update
RUN yum -y install git
CMD [""]

Once I have dcoekr file handy. I ran below command to build an image which has base image of centos and git is being installed,

 -> docker build -t centos:1.0.0 .(Location of where you have dockerfile)
 -> docker images - You can see the image which we built
     [root@localhost kishoreLab]# docker images
     REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
     centos                  1.0.0               56f868464603        2 minutes ago       641 MB


  • Create a POST and Send a URL of post in Zoom Chat.
  • Of Assignment#1 – Assignment#2 – Assignment#3 in one post
  • Post title can be of your choise