Skip to main content

How to run Docker inside Docker Container?


Step 1 : Docker pull centos


Step 2 : 1. mkdir storage

          2. cd storage/




Step 3 : docker run -it --privileged -v /root/storage:/var/lib/docker --name os1 centos



1.   We used privileged mode because to run docker engine inside docker container it will be failed due to some security reason. A privileged container means it have all root capabilities of host machine

2.   Docker store all data like containers, images, networks, plugins and many mores inside in one place that is /var/lib/docker, so this folder is most important folder. We know if we terminate any container than all the content inside the container will be removed. So, for that reason we create a folder that is mystorage inside in host machine and linked this folder with that folder /var/lib/docker means we create a persistent storage of that folder /var/lib/docker

Now we install docker on centos environment for that first we create a repo file inside in /etc/yum.repos.d

Step 3 : vi /etc/yum.repos.d/docker.repo



Step 4 : Write this command

Write this content to this repo file

[docker]

baseurl=https://download.docker.com/linux/centos/7/x86_64/stable/

gpgcheck=0


Step 5 : yum install -y docker-ce --nobest



Step 6 : dockerd &

This will start the docker in background and now u can execute the docker commands


Step 7 : 1. docker pull alpine

          2. docker images

          3. docker run -it --name os2 alpine
         
          4. docker ps




Comments

Popular posts from this blog

Run any GUI software in docker container

 

Vivo Announces Android 11-Based Funtouch OS 11 Beta Update Schedule for India

Vivo has announced the rollout schedule for the beta version of its Android 11-based Funtouch OS 11 in India that will go on till June. The Vivo V20 debuted with the stable version of Android 11 with Funtouch OS 11 in October, and the Vivo X50 Pro started receiving the update last month, but the company was yet to announce the schedule for its older models. The update schedule has devices ranging from the budget segment to the premium segment. The company took to Twitter to reveal its Android 11-based Funtouch OS 11 beta rollout plan. Vivo clarified that users will receive the update on a batch-by-batch basis. The Vivo V20 and the Vivo V20 Pro are already running on the latest OS. The Vivo X50 Pro, too, started receiving the update last month, Vivo said. The Vivo V19 and the Vivo X50₹ 34,990 will start receiving the Android 11-based Funtouch OS 11 beta version update at the end of January 2021, while Vivo V17, Vivo V17 Pro₹ 27,375, Vivo V15 Pro, and Vivo S1 will start receiving the upd...

Introduction Types of Computer Network

  What is a Computer Network? Computer networks is bunch of computers connected through optical cables, wires and fibers so that it interacts with each other through networks. The goal is to share the content and the information among the system of same network or other. In computer networks there are different types of networks that shares the information among each other they maybe simplex or complex ones.