There are many resources online, many great ones even free to learn Docker
But what is the path to learning Docker from Zero, so you can choose your own videos/articles?
Here is the path I suggest in 10 steps.
Let's see them together:
...
1) Understanding WHAT it is and what it isn't, what are the building blocks of it
2) Understanding what containerization is and why it is so important. Differences Containers/Virtual Machines
3) Install Docker on your operating system and make sure it works (`docker info`)
...
4) Take a look at "Docker Hub" and make a bit of practice using one image there (eg Nginx) and understand the basic commands: start/stop/list containers.
5) Understand how the components are made and their configuration: commands inspect/exec/logs.
...
6) Learn how to create an image (at this point you should have a clear idea of what it is) starting from a Dockerfile. The best here is to use an application you have build. It can be with any programming language. docker build options.
...
7) Understand how persistence in containerization works. Volumes and bind mounts and differences between them.
8) Basic concepts of networking for containers, what types of networks exist, the default, difference between networks on the same machine and on different machines
...
9) Getting started with docker-compose, understanding how to build images with it, and how to manage different services in the same file. base up (--build option) and down commands
10) Learn how to deploy your app using a cloud provider (AWS, Azure, GCP, Digital Ocean, ...)
...
Recap:
1 What is Docker
2 Containerization VS VMs
3 Install Docker
4 Basic Commands
5 Inspect/Debug containers
6 Dockerfile and build an Image
7 Volumes
8 Networking
9 Docker-Compose
10 Deploy on a cloud provider
• • •
Missing some Tweet in this thread? You can try to
force a refresh
-d: Run in detached mode
-e: Set new environment variable
--env-file: use an external file for env variables
-i: Keep the Standard Input open
-t: pseudo Terminal (TTY)
-u: define a user for the command
-w: define a working dir inside the container
...
The most common use case:
Use the exec command to get inside a running container
Example:
`docker exec -it <container_id> bash`
This works for most of the containers running based on Linux images
and me, because I create content about it every single day.
WHAT is Docker?
A container technology, a platform to build and manage containers.
You package the code with all the dependencies you need in order to run your application everywhere in a smart, reliable way.
Think about it as a Mountain Backpack, you can bring with you
The instruction is not case-sensitive, but the convention is to be UPPERCASE to distinguish them from arguments more easily.
add # to add a single-line comment
... 2/25
.dockerignore
Before sending the context to the Docker daemon, the Docker CLI checks if a .dockerignore file is in the root directory. If so it excludes files/dirs that match patterns in it.
The Docker client talks to the Docker daemon (server), which menages different docker objects:
- Images
- Containers
- Networks
- Volumes
Let's see in details:
... 1/12
The Docker client and the daemon can run on the same system, or they can be connected remotely using HTTP protocol.
The connection is established using REST APIs, over UNIX sockets/network interface
... 2/12
DOCKER DAEMON (SERVER)
The Docker daemon (dockerd) is a process, which runs in the background, that manages the docker objects (images, containers, networks, volumes). It processes Docker API requests