How to Install & run docker inside docker?


 ➤ Launch a container in “privileged” mode.

 What is the “privileged” mode?

"Docker privileged mode grants a Docker container root capabilities to all devices on the host system. Running a container in privileged mode gives it the capabilities of its host machine."

          docker run -it --privileged --name docker centos


 ➤ Install yum-utils & set-up repository

 1.yum install -y yum-utils 

 2.yum-config-manager \ --add-repo \                                                   https://download.docker.com/linux/centos/docker-ce.repo 


 ➤  Now Install the Docker in launched container

     yum install docker-ce -y


➤ Now start the Docker Daemon

What is Docker Daemon?

"Docker daemon is installed on a host machine and essentially acts as the brain of the Docker. it creates and manages your Docker images."


 

➤ What is /Var/run/docker.sock ?

/var/run/docker.sock is basically the Unix socket the Docker daemon listens on by default. It is also a tool used to communicate with the Docker daemon from within a container.

    

        dockerd &
        dockerd is used for starting the Docker daemon














➤Now Download the OS  in the container 

       docker pull centos
  

        

➤Now Launch the new container

    docker run -it --name dockerindocker centos


























Comments

Popular posts from this blog

Revolutionizing Industries: Solving Challenges with Ansible

Creating a Python Script to Capture and Process Face Photos