Hi 👋there,
Now we are on the Day 16 task
Docker for DevOps Engineers
Checkout the below link for Day 16 task:
https://github.com/LondheShubham153/90DaysOfDevOps/blob/master/2023/day16/tasks.md
Docker
Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.
Tasks
Install Docker on your server first.
Checkout the below link for docker installation:
https://docs.docker.com/engine/install/ubuntu/
some Docker Commands:
1.) Use the docker pull
command to pull the image from the docker hub.
Then we used the docker run command to run a container in detached mode using the pulled image.
2.)To create a container with a container name:
1.)without a port map
command — docker run -d — name <container-name> <image-name>
2.)with a port map
command — docker run -p — name <container-name> <image-name>
-
- 3.) Use the
docker inspect
command to view detailed information about a container or image.
- 3.) Use the
4.) Use the
docker port
command to list the port mappings for a container.docker port
is a Docker command that displays the public-facing port(s) of a running container.
docker port <container name>
5.)Use the
docker stats
command to view resource usage statistics for one or more containers.docker stats
is a Docker command that displays real-time usage statistics for running containers.docker stats [OPTIONS] [CONTAINER...]
Options:
— no-stream: Disable streaming stats and only pull the first result
— no-trunc: Do not truncate output
— all , -a: Show all containers (default shows just running)
— format: Pretty print images using a Go template
6.) Use the
docker top
command to view the processes running inside a container.
docker top
is a Docker command that shows the processes running inside a container.
The output of the docker top
command includes the process ID, user, CPU usage, memory usage, and command that is being executed by each process.
docker top <container name>
- 7.)Use the
docker load
command to load an image from a tar archive.
docker load
is a Docker command that loads one or more Docker images from a tar archive.
docker load [OPTIONS] < myimages.tar
- Use the
docker save
command to save an image to a tar archive.
docker save
is a Docker command that saves one or more Docker images to a tar archive.
docker save [OPTIONS] IMAGE [IMAGE…]
Please, feel free to drop any questions in the comments below. I would be happy to answer them.
If you find this post helpful😊🙂, please follow and click the heart❤❤ button below to show your support.
_ Thank you for reading
_sandhya kumari