Docker-in-Docker means we can run Docker containers inside another Docker container.
In Docker world One process communicate with Other process is because od "Unix Socket".
Command for go Location:
cd /run/containerd/
Command for list:
ls -i
-
Lauch Container by sharing Host Docker Socket (-v /run/containerd/:/run/containerd/ )
-
Give all capabilities to the container (--privileged) --privileged <> Give extended privileges to this container
When we create container have very limited power(not root power) or Capabilities,that not able to Launch 'New container in it',
but Running in "--privileged" mode to new container give All capabilities to Start Dockerin it .
- Prerequisite: AWS account
Command for download Docker:
yum install docker -y
Command for start Docker Service:
systemctl start docker
docker pull docker
docker run -dit --privileged --name myDinD docker
Step-4: [Attach new Container(myDinD) in that Container install Docker again] {DOCKER 2 inside DOCKER1}
docker exec -it myDinD sh
docker info
All docker command run in myDinD that is 'Docker inside Docker'
docker ps
docker images
docker pull docker
Command for run Container with --privileged:
docker run -dit --privileged --name myDinD2 docker
Command for attach or get shell terminal of running Container:
docker exec -it myDinD2 sh
1.Docker host (Docker 1)
2.myDinD container (Docker 2 inside Docker 1)
3.myDinD2 container (Docker 3 inside Docker 2)