image

In this lab we will be working with docker images, we modify docker image to suite our needs

Create docker hub account. Docker Hub skip this step if you already have one

image

Open Play with Docker

image

login with your docker hub account.

image

Click on start

image

It will start a 4 hr session

image

click on + ADD NEW INSTANCE

image

Run a docker container with image ubuntu and connect to to perform below command

apt-get update
apt-get install -y figlet
figlet "hello docker"
Solution
docker container run -it ubuntu bash
apt-get update
apt-get install -y figlet
figlet "hello docker"
exit

List all docker containers

Solution
docker container ls -a

List and verify all change made to container

Solution
docker container diff <container ID>

Create new docker image which include all changes you have made in previous step

Solution
docker container commit CONTAINER_ID

List all docker images

Solution
docker image ls -a

Update name on docker image you created in previous steps

name firstimage
tag 1.0
Solution
docker image tag <IMAGE_ID> firstimage

List all docker images

Solution
docker image ls -a

Run docker container with new image and command figlet hello

Solution
docker container run firstimage figlet hello

Delete all three nodes and close session

  1. click on first node and then DELETE
  2. Repeat same for second and third node
  3. click close session

image

Congratulations you have completed this lab

Let us know if you still have any question
Youtube video for this lab