Here I have covered,
What is Docker?
What is "Image" in Docker?
What is a "Container" in Docker?
What is a "Container Image" in Docker?
Docker Commands.
What is Docker?
Docker is a container platform that allows you to build, test and deploy applications quickly.
A Developer defines all the applications and their dependencies in a
Dockerfile
which is then used to build docker images that define Docker container.Doing this ensures that your application will run in any environment.
What is "Image
" in Docker?
In Docker, an image is a
lightweight
,stand-alone
,executable package
that includes everything needed to run a piece of software, including the code, runtime, libraries, environment variables, and any other dependencies.Docker images are typically built using a
Dockerfile
, which is a text file that contains a set of instructions for creating the image.
What is "Container
" in Docker?
- A Container is a way to package applications with everything they need inside the package including the dependencies & Configuration.
What is "Container Image
" in Docker?
When running a container, it uses an isolated file system. This custom file system is provided by a container image.
Since the image contains the container's file system, it must contain everything needed to run an application
-all dependencies
,configurations
,scripts
,binaries
etc.The image also contains other configurations for the container such as environment variables, a default
command to run
and other metadata.
How to check Docker Version?
Docker Commands:
docker pull <image_name>
-> This command is used to image from the local repository or from DockerHub.
docker container
-> This command is used to list all the containers of images.
docker run <image_id>
-> Docker run means to run an image to create a container.
Docker Desktop AppView
Running in Interactive Environment
docker inspect <image_id>
-> It will give all the information of the container.(eg.state,path,id)
docker port
-> This command is used for mapping port for containers.
WebView on httpport:27017
docker stats <image_id>
-> This command shows the resource usage statistics for one or more containers.
docker top <container_id>
-> This command shows the processes running inside a container.
docker save
-> This command is used to save an image to a tar archive.docker save [OPTIONS] IMAGE [IMAGE...]
docker load
-> This command is used to load an image from a tar archive.