Today, you will learn the basics of Docker.
StackOverflow called it one of the most universally used tools this year.

Developers are obsessed with it.
But why? Is it that useful?
Why Docker
Imagine this.
You have a working Python code on your computer.

You send it to a friend.

But for some reason


What happened?
You found out that he's still using Python 2!
The code that works on your machine COULD FAIL, just because itβs in another environment.
Aka the βit works on my machine problem.β
Docker fixes that by packaging your code into containers.
Docker Containers
Containers are like mini computers.
It contains everything your program needs.

So your code runs the exact same way on any machine.

A container isnβt something magical. Itβs just a process running on your computer that has its own filesystem, network, etc.
Basic Docker Workflow
To make a container, first create a Dockerfile (the filename is literally Dockerfile).

Inside, specify everything required to run your code.

Python 3.11, a Linux-based environment, command: βpython main.pyβ
You could just send your friend the file & your code and tell him to build a container based on that.
But there's a better way: build a Docker Image.

A Docker image is a static, shareable version of your environment.
Itβs very easy to create, just run this command:
docker build -t my_app .
After you share the image, your friend can run your code easily by creating a container.

He doesn't even have to install Python. He just has to run one command:
docker run my_appDocker will create a container on his computer based on the image.
Now your code works on his machine, or any other.
Fee from Anime Coders
