<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/dockerlabs/dockerlab102_hue5ec8e1ed46d27227a3b2839feba95c7_807839_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/dockerlabs\/dockerlab102_hue5ec8e1ed46d27227a3b2839feba95c7_807839_600x400_fit_q100_box_3.png'" />
In case you prefer a video, check below our YouTube video for this lab
Create docker hub account Docker Hub skip this step if you already have one
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/dockerlogin_hu1f221f14fe461ff4690c69ff8c84d3c3_315570_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/dockerlogin_hu1f221f14fe461ff4690c69ff8c84d3c3_315570_600x400_fit_q100_box_3.png'" />
Open Play with Docker
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/dockerlabs/pwdlogin_hueec0bc8809651a680023e3a6dcf3c12b_161832_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/dockerlabs\/pwdlogin_hueec0bc8809651a680023e3a6dcf3c12b_161832_600x400_fit_q100_box_3.png'" />
login with your docker hub account.
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/k8slabs/pwklogindocker_hu053a2a27610a25d64121ac431c222785_112564_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/k8slabs\/pwklogindocker_hu053a2a27610a25d64121ac431c222785_112564_600x400_fit_q100_box_3.png'" />
Click on start
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/dockerlabs/pwdstart_hu7b3fbdc65158677466b15ae9b9e2a4ca_67286_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/dockerlabs\/pwdstart_hu7b3fbdc65158677466b15ae9b9e2a4ca_67286_600x400_fit_q100_box_3.png'" />
It will start a 4 hr session
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/k8slabs/pwksession_hu5b589b6b0073ab182d99a0ab899ae088_109284_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/k8slabs\/pwksession_hu5b589b6b0073ab182d99a0ab899ae088_109284_600x400_fit_q100_box_3.png'" />
click on + ADD NEW INSTANCE
<img
title="image"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/k8slabs/pwkaddnode_hu5b589b6b0073ab182d99a0ab899ae088_102350_600x400_fit_q100_h2_box_3.webp"
alt="image"
onerror="this.onerror='null';this.src='\/images\/practice\/k8slabs\/pwkaddnode_hu5b589b6b0073ab182d99a0ab899ae088_102350_600x400_fit_q100_box_3.png'" />
Task: pull below docker images
ubuntu
ubuntu:18.04
ubuntu:20.10
ubuntu:16.04
alpine
alpine:3.12.0
alpine:3.11.6
alpine:3.10
Use below command to complete this task
docker pull ubuntu
docker pull ubuntu:18.04
docker pull ubuntu:20.10
docker pull ubuntu:16.04
docker pull alpine
docker pull alpine:3.12.0
docker pull alpine:3.11.6
docker pull alpine:3.10
Task: check docker images available on local system
docker images
Task: check all docker images available on local system
docker images -a
Task: check all docker images for ubuntu available on local system
docker images ubuntu
Task: check all docker images with docker image command
docker image ls
Task: Run a docker container with image alpine
and run command ls -la inside it
docker container run alpine ls -l
Task: Run a docker container with image alpine and run command echo “hello from alpine” inside it
docker container run alpine echo "hello from alpine"
Task: Run a docker container with image alpine and connect to its shell
docker container run alpine /bin/sh
Task: Run a docker container with image alpine and connect to its shell
write to “hello world” to hello.txt
docker container run -it alpine /bin/ash
echo "hello world" > hello.txt
Task: list all running docker containers on local system
docker container ls
docker container ls -a
Task: Start docker container from previous step
docker container start <container ID>
TasK: Connect to docker container used in previous step using docker exec
docker container exec -it <container ID>
Delete all open nodes/instances and close session
Select the node and click on DELETE
Repeat same for any other open nodes
click close session
