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
Task 16 was all about running Docker commands, and it was a great opportunity to dive deeper into the world of containers. Here are some of the commands I learned and experimented with:
docker run : create and run a new container based on a specified Docker image.
docker inspect : is a command to view detailed information about a container or image.
docker port : To list the port mappings for a container. This command is used to inspect ports that are actively mapped and in use by a running container.
Here's an example of how you might use the docker port
command:
docker port my_container
docker stats : is a command that displays real-time resource usage statistics for one or more running Docker containers.
docker top : is a command is used to display the running processes within a specific Docker container.
Here's an example of how you might use the docker top
command:
docker top my_container
docker save : is a command used to save one or more Docker images, along with their layers and metadata, into a tarball archive file.
Here's an example of how you might use the docker save
command:
docker save -o my_images.tar my_image1 my_image2:tag1 my_image3:latest
docker load : is a command used to load Docker images, along with their layers and metadata, from a tarball archive file that we created using the docker save
command above.
So as you remember we save the archive file with the name my_images.tar
Here's an example of how you might use the docker load
command:
docker load -i my_images.tar
Happy Learning!