Explain basic Docker usage workflow

Technology CommunityCategory: DockerExplain basic Docker usage workflow
VietMX Staff asked 3 years ago
  1. Everything starts with the Dockerfile. The Dockerfile is the source code of the Image.
  2. Once the Dockerfile is created, you build it to create the image of the container. The image is just the “compiled version” of the “source code” which is the Dockerfile.
  3. Once you have the image of the container, you should redistribute it using the registry. The registry is like a git repository — you can push and pull images.
  4. Next, you can use the image to run containers. A running container is very similar, in many aspects, to a virtual machine (but without the hypervisor).
    +------------+  docker build   +--------------+  docker run -dt   +-----------+  docker exec -it   +------+
    | Dockerfile | --------------> |    Image     | --------------->  | Container | -----------------> | Bash |
    +------------+                 +--------------+                   +-----------+                    +------+
                                     ^
                                     | docker pull
                                     |
                                   +--------------+
                                   |   Registry   |
                                   +--------------+