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
WHERE can you use Docker?
Another good news: Docker runs natively on Linux, but you can install Docker Desktop on Windows or Mac and run your application without surprises.
(There are also Windows containers, but that's another story)
Fun fact: It uses a little VM to work!
WHEN should you learn Docker?
The earlier, the better.
I suggest starting learning Containerization, using Docker, after you build your own first application, so you can deploy it everywhere and you appreciate all the advantages on your real project.
WHY Docker?
Why do you need it?
- To have the same environment in development/production (the dream of every developer)
- To use different versions of the same Software without headaches.
- To let new collaborators get started in minutes
• • •
Missing some Tweet in this thread? You can try to
force a refresh
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.
-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
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