Professional Documents
Culture Documents
Docker
Docker
Developer Tester
The code does not work on the other system due to the
difference in computer environments.
Solutions
VM Docker
Docker concepts
Docker containers
Containerization is a type of virtualization in which all the components of an
application are bundled into a single container image and can be run in isolated user
space on the same shared operating system. Containers are lightweight, portable, and
highly conducive to automation.
Docker client(CLI)
The Docker client (docker) is the primary way that many Docker users interact with
Docker. When you use commands such as docker run, the client sends these
commands to dockerd, which carries them out. The docker command uses the
Docker API. The Docker client can communicate with more than one daemon.
Docker Server(Daemon)
The Docker daemon (dockerd) listens for Docker API requests and manages
Docker objects such as images, containers, networks, and volumes. A daemon
can also communicate with other daemons to manage Docker services.
Docker Hub
A Docker registry stores Docker images. Docker Hub is a public registry that
anyone can use, and Docker is configured to look for images on Docker Hub by
default. You can even run your own private registry.
When you use the docker pull or docker run commands, the required images are
pulled from your configured registry. When you use the docker push command,
your image is pushed to your configured registry.
Image
An image is a read-only template with instructions for creating a Docker
container. Often, an image is based on another image, with some additional
customization.
You might create your own images or you might only use those created by
others and published in a registry. To build your own image, you create a
Dockerfile with a simple syntax for defining the steps needed to create the
image and run it. Each instruction in a Dockerfile creates a layer in the image.
When you change the Dockerfile and rebuild the image, only those layers which
have changed are rebuilt. This is part of what makes images so lightweight,
small, and fast, when compared to other virtualization technologies.
Container
is a runnable instance of an image. You can create, start,
stop, move, or delete a container using the DockerAPI or CLI.
can be run on local machines, virtual machines or deployed
to the cloud.
is portable (can be run on any OS).
is isolated from other containers and runs its own software,
binaries, and configurations.
Docker Desktop
Follow the installation process to allow the installer and wait till the
process is done.
After completion of the installation process, click Close and restart.
Here is the run command you need to get the tutorial started:
docker run -d -p 80:80 docker/getting-started
You can find out more details about your installed version by running:
docker info
Docker The Docker dashboard gives
you a quick view of any
Docker will then start a container from the image and execute the "Hello,
World!" program, which will display a message in the terminal confirming
that everything is working correctly.
Docker Commands
docker run: starts a new container from an image
docker pull: downloads an image from a registry
docker build: creates a new image from a Dockerfile
docker ps: lists all running containers
docker stop: stops a running container
docker rm: removes a container
docker images: lists all images on the system
docker rmi: removes an image
docker exec: runs a command inside a running container
docker logs: prints the logs of a container
docker inspect: detailed information about a container or image