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
Open Play with Docker
login with your docker hub account.
Click on start
It will start a 4 hr session
click on + ADD NEW INSTANCE
Task: Run a docker container with image nginx and expose port 80 as 8080
docker run -p 8080:80 nginx
Task: List all docker containers
docker container ls -a
Task: Start container from previous step
docker start <container id>
Task: Stop container from previous step
docker stop <container id>
Task: Run a docker container with image nginx and expose port 80 as 8080 and name it app1
docker run --name app1 -d -p 8080:80 nginx
Task: Check logs from docker container we created in previous step
docker logs app1
docker logs -f app1
Task: Restart container from previous step
docker restart app1
Task: Check process running inside docker container we created in previous steps
docker top app1
Task: Kill container from previous step
docker kill app1
Task: Remove container from previous step
docker rm app1
docker rm -f app1
Task: Delete all open nodes/instances and close session