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

Detailed Analysis on Arduino UNO R3

Arduino UNO R3 Arduino Uno is a microcontroller board based on ATmega328P . It has 14 digital input/output pins 6 Analog pins a 16 MHz quartz crystal oscillator with USB connection ,a power jack , an ICSP(In-Circuit Serial programming) header and a reset button actually it has two reset buttons . Also Arduino uno has RX-0,TX-1 that is receiving and transmitting pins on board. Arduino uno contains  AREF pin which means Analogue-Reference IOREF pin this pin is provides a voltage  reference at which the microcontrller works 3-ground pins 3-Vcc pins Basically the purpose of creating an Arduino Uno is to Control the sensors and the actuators so that it can work accordingly the data which we provide with the help of software . Nowadays people using Arduino Uno in many fields it has very huge scope in  the field of  IOT(Internet Of Things). Also in my current project which is 2D-printer we have used Arduino Uno which sense the Data and according...

Run any GUI software in docker container

 

how to make a static IP Address of an Raspberry-pi

How To Make Raspberry-pi ip-Address Static and show an virtual window of raspberry-pi on Windows desktop through VNC-Viewer STEP  1: Disconnect your Desktop from Windows operating system. STEP  2: Connect your Raspberry-pi to your pc install the Raspbian from the below link STEP  3: Download BalenaEtcher which is basically an image flasher which is going to flash the image of the OS that is Raspbian on the SD card on any USB  for further details go to the link below and download it. Also you can download Win32diskmanger to flash the OS STEP  4: Now as we download the Raspbian and also we flash it now Download the VNC viewer through the below link  STEP  5: Now open the Terminal on Rasberry-pi and write the following commands 1. ifconfig : Check out the  ip-address , sub-net mask 2. netstat -nr : This command will tell you about the  gateway address 3. sudo nano /etc/network/interfaces : This command will give the netwo...