Launch a container in docker. Further, launch a container then install docker in it and again launch a container in containerized docker.
Introduction
Docker in Docker (also known as dind) is, as the name implies, running Docker on top of a Docker container. Controlling containers from a Docker container is not a particular use case but is often necessary to run CI tools such as Jenkins on top of a Docker container. It is not a specific use case but is often needed to run CI tools such as Jenkins on Docker containers.
This article describes two approaches to achieving Docker in Docker and introduces some points to consider when using Docker in Docker.
Docker in Docker Using dind
This method uses a container with Docker installed and runs a Docker daemon in the container separately from the host. Alpine based Docker official image and ubuntu based teracy/ubuntu are available as images for DinD. (dind tag) based on alpine, and teracy/ubuntu based on ubuntu.
The following is an example of the command for Docker-in-Docker using the official Docker image docker:stable-dind
.
docker run --privileged --name dind6 -d docker:stable-dind
docker exec -it dind6 /bin/ash
Running Docker Inside Docker:
Hence container has launched inside the container……
………………………………………..THANK YOU………………………………………