Page 1 of 1

Install Docker on a Linux VM. You don’t want to install it on your computer, because it will interfere with other functi

Posted: Thu Jul 14, 2022 2:13 pm
by answerhappygod
Install Docker on a Linux VM. You don’t want toinstall it on your computer, because it will interfere with otherfunctions on your computer. Open a Linux VM, set thenetwork configuration to be NAT. Download and install Docker insidethe Linux VM as an admin. The remaining exercisesare to be performed inside the Linux VM. Open a terminalinside the Linux VM. The following exercises won’trun on Windows VM.
A few useful Docker sites:
Google "How to install Docker on Centos VirtualBox"
Don't install other stuff. Only run the commands shown below.Other software or packages will have dependencies and may causeyour VM to have inconsistent dependencies. That will be a nightmareto upgrade all the dependencies to a workable stage.
Below link is after you installed docker.
docker-curriculum (dot.) com
(1) Open a terminal from your CentOS v7 VM
(2) $ sudo su -
(Change you to super user. The prompt changesfrom "$" to "#".)
(3) # yum install docker
(4) # systemctl start docker
(5) # systemctl status docker
(To be sure that docker is running.)
(6) # docker images
(There is no docker images.)
(7) # docker run hello-world
(run the built-in application "hello-world"inside Docker.)
(8) # docker images
(show that "hello-world" application isrunning).
(9) # docker pull busybox
(go to internet to download busyboxapplication)
(10) # docker run busybox
(11) # docker run busybox echo“hello world from Sophia”
Change "Sophia" to your name.
(12) # docker ps
--------------------------------------------------------------------------------
Snapshots of the results for the following requiredsubmissions.
(Q1): From the terminal, type in the following commands and takesnapshots after running each command.
To validate the installation is correct, type
$ docker run hello-world
(Q2): Run a Busybox container. The pull commandfetches the busybox image from the Docker registry andsaves it to the VM.
$ docker pull busybox
(Q3): Find available docker images in yourVM.
$ docker images
Check that busybox container is
(Q4): Run the Docker container busybox. When you runthe Docker image bosybox, Docker loads up the container andthen runs a command in the container. When we run“docker run busybox”, there is no command, so Docker didnothing and exited.
$ docker run busybox
If you provide a command after “docker run busybox”,that command will be executed
$ docker run busybox echo “hello world fromJasper”
Replace ‘Jasper’ with your name. That way I know that you arerunning Docker by yourself. Take a snapshot.
(Q5): Run the following command to check what containersare currently running.
$ docker ps
It should be no docker running.
Run the following command to see a list of all containers thatwe ran. Notice the STATUS column shows that these containers exiteda few minutes ago. Take a snapshot.
$ docker ps –a
Run the following local host command to see the difference withand without Docker.
$ ps -a
(Q6): Compare Virtual Machine (VM), Container, and Sandbox withthe following features in the table.
Features\Types
VM
Container
Sandbox
Same OS as host OS
Share data with host
Data remains when the VM / Container / Sandbox isclosed
Additional OS overhead
Performance
Storage space
Communication among the applications and host
Security level
Examples of applications
Advantages
Disadvantages