<img
title="docker lab 104"
loading="lazy"
decoding="async"
class="img-fluid img-center"
width="600"
height="400"
src="/images/practice/dockerlabs/dockerlab104_hue5ec8e1ed46d27227a3b2839feba95c7_810260_600x400_fit_q100_h2_box_3.webp"
alt="docker lab 104"
onerror="this.onerror='null';this.src='\/images\/practice\/dockerlabs\/dockerlab104_hue5ec8e1ed46d27227a3b2839feba95c7_810260_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="play with docker start"
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="play with docker start"
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="play with kubernetes session"
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="play with kubernetes session"
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="play with kubernetes node"
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="play with kubernetes node"
onerror="this.onerror='null';this.src='\/images\/practice\/k8slabs\/pwkaddnode_hu5b589b6b0073ab182d99a0ab899ae088_102350_600x400_fit_q100_box_3.png'" />
Task: Create a Dockerfile to create a docker image
vi Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install figlet
CMD ["figlet", "hello docker"]
Task: Build docker image with Dockerfile from previous step
docker image build -t imageformfile:0.1 .
Task: Run docker container with image build in previous step
docker container run imageformfile:0.1
Task: List all docker images on local system
docker image ls -a
Task: List all all changes made to docker image
Use image from previous step
docker image history <image ID>
Update you docker image with 0.2
vi Dockerfile
CMD ["figlet", "hello docker 0.2"]
TasK: Build docker image with updated Dockerfile from previous step
update tag to 0.2
docker image build -t imageformfile:0.2 .
Task: Run docker container with image build in previous step
docker container run imageformfile:0.2
Task: 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
