
Introduction to the Docker Hands On Practice Course
Learn to provision a digital ocean droplet, configure hardware and access, install and verify docker on a linux vm, and confirm docker is running via docker ps and docker version.
Learn the essentials of Docker through hands-on commands, including running and inspecting containers, managing images, networks, and volumes, and using exec for interactive shells inside containers.
Verify your Docker setup by running docker --version to check the installed version, and use docker version to list all component versions and the commit.
Search the docker hub for the busybox image using docker search, and verify the official image.
Pull the latest busy box image from Docker Hub, then verify the download with docker pull busy box and docker images.
Run a Docker container with the busy box image, execute the LZ command inside the container, then list the current working directory to confirm the root directory contents.
List all running containers using the Docker command to view container IDs, used images, default commands, status, exposed ports, and container names.
Learn to list both running and stopped containers in Docker using docker ps and docker ps -a, including exited ones, illustrated with BusyBox containers.
Run an interactive ubuntu container with docker run -it ubuntu bash, downloading the image if needed. Detach with Ctrl-P Ctrl-Q to keep it in the background and reconnect later.
Run a Docker container in the background with an Ubuntu image, print its container ID, and learn how to list active containers.
Identify the container ID with docker ps, then stop the Ubuntu container using docker stop <container_id> to ensure it no longer runs.
Remove a running docker container using docker rm -f, then verify removal by running docker ps and docker ps -a to confirm it no longer appears.
Create an Ubuntu container, then copy the bootstrap.log file from the container to your local machine using docker cp, and verify with ls.
Log into a running docker container using docker exec, set the default shell to bash, verify an empty file exists, and exit, confirming successful in-container file creation.
Create a new container from the nginx image, run it in the background, then print its logs with the docker logs command to view the container's internal server activity.
Create a container from an image, then kill it using the docker kill command instead of stop. List containers with docker ps to confirm it disappears.
Pull a http image, save it to a tar file with docker save, redirect the output to a file, and verify the tar file on the system.
Create a new Ubuntu container, then monitor its real-time resource usage with docker stats to view CPU usage, memory usage, networking, and block IO.
Create a new Ubuntu container with docker run, then print its processes using docker top, then repeat for an engine X container.
Create a Docker container from the Gen X image, obtain the container ID, and restart it with docker restart to verify it comes back up.
Learn how to list all docker images on your machine using the docker images command, and view image ID, creation date, and size from your local system.
Learn to inspect docker images on your local machine by listing images and running docker inspect to view complete image metadata for ubuntu and busybox.
Delete a local docker image by running docker rmi, and force removal with -f followed by the image name; verify removal with docker images.
List existing images and running or stopped containers, then prune unused images with docker image prune. Remove images not linked to any container and reclaim around 145 GB of space.
Display the ubuntu image history by listing images, pulling ubuntu, then using docker history to show the image lineage.
Learn to convert a running Docker container into a new image using Docker commit, including installing software like Apache2 and verifying changes with a subsequent container.
Run Docker network ls to list the default Docker networks on your system. Identify the bridge network and the host network among these defaults.
Learn to inspect a docker bridge network using docker network inspect to view subnets, drivers, and IPv6 status.
Create a bridge network named my network with Docker network create. The default driver is bridge, and you can create your own network.
Create a new container from the Ubuntu image and attach a custom network using the --network option, then verify the network mode with docker inspect.
Disconnect the network from a running container using docker network disconnect, specifying the network name 'my network' and the container name.
Delete a docker network from your local machine by running docker network rm network-id or name, then verify it's gone with docker network ls.
Learn how to remove unused Docker networks on your local machine using Docker network prune, keeping your environment clean by deleting unused networks.
List all Docker volumes on your system with docker volume ls, and observe that since no volumes are created yet, no results appear.
Run a Jenkins container from Jenkins:2.60.2, expose port 8080, and mount the previously created volume to Jenkins home, then verify Jenkins is online via the host IP.
Kill the Jenkins container and remove its volume from your system. Use docker ps to identify the container, docker rm to remove it, and docker volume rm to delete the volume.
Execute docker volume prune to remove all unused volumes, confirming with y; this clears unused volumes from your system.
Run a Jenkins container with port 8080 exposed and a bind mount of /tmp to Jenkins home, using docker run -p and -v with Jenkins:2.60.2.
Create a Dockerfile using ubuntu as base image, add a DevOps label, and set an environment variable pass with the value my pass, then build and tag as my ubuntu:1.
Modify the docker file to add a run command that writes the date to a file inside the container, then build with tag two and run to verify.
Create a Dockerfile with Alpine as base, add a label, and set cmd to sleep for 60 seconds. Build and run to see the container exit after the delay.
Learn how to set up a GitLab account by signing up, completing basic details, choosing a Google login, accepting terms, and accessing GitLab with Gmail.
Create your first GitLab project, name it autopilot devops, set a private visibility, and optionally add a readme, while exploring deployment targets such as Kubernetes, self-managed containers, or Heroku.
Create a new digital ocean Ubuntu droplet, choose a 2 gb ram plan with free credits, set a password, and connect via ip to set up ansible.
Configure a GitLab runner as a sudo user on the render machine and install docker on the Ubuntu host to enable docker-based pipelines; verify by listing containers.
Create and test a GitLab CI pipeline to validate your lab setup, using a single build stage and a tagged job that echoes and lists Docker images on the runner.
Create and commit a docker file and an index.html in a GitLab project, using a base http image and injecting the index page into the image, prepping for GitLab CI/CD.
Learn to build a GitLab CI pipeline for Docker with build, test, and deploy stages, building Docker images and pushing them to the GitLab container registry using secret variables.
Docker Practice Questions | Practice Docker Hands On 50 Task
Docker Hands On Questions | Docker Practical Tasks | 50 Hands On Tasks | Docker Commands, Docker Networks, Docker Image, Docker Volumes and Docker Files
This is a complete hands on course where you will be asked to work on 50 Docker based tasks, all the questions will be given with proper solution and description section.
Below are the topics that will be covered under this course:
docker run
docker ps
docker rm
docker stop/start
docker cp
docker exec
docker rename
docker pull
docker save/load
docker log
docker stats
docker top
docker version
docker inspect
docker port
docker kill
docker list images
docker inspect
docker rmi
docker prune
docker history
docker commit
docker n/w ls
docker n/w inspect
docker n/w create
docker n/w disconnect
docker n/w attach
docker n/w create host
docker n/w remove
docker n/w prune
docker vol. ls
docker vol. create
docker vol. rm
docker vol. prune
docker vol. bind
docker vol. attach
#DockerFiles Questions covers:
FROM
LABEL , ENV
RUN
COPY
CMD
BUILD/TAG
In case you still have any query, you can reach out to us in the Q/A Section over Udemy, We will be happy to help !!
All the best and Keep Learning !!
Thanks,
AutoPilot DevOps Team
Docker Hands On Questions | Docker Practical Tasks | 50 Hands On Tasks | Docker Commands, Docker Networks, Docker Image, Docker Volumes and Docker Files
You can also refer to our other courses as well:
Bash Scripting Practice Questions ( 100 Tasks | Hands On )
Ansible Practice Tasks | 50 Ansible Playbooks Hands On Tasks