In case you prefer a video, check below our YouTube video for this lab
Open Play with Docker
login with your docker hub account.
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