Docker is a platform for developers and sysadmins to build, run, and share applications with containers. The use of containers to deploy applications is called containerization. Containers are not new, but their use for easily deploying applications is. Source:Docker Docs.
Fundamentally, a container is nothing but a running process, with some added encapsulation features applied to it in order to keep it isolated from the host and from other containers.
First of all you need to install Docker, the steps will depend on your OS:
note: You need Windows 10 Pro, Enterprise or Education (tip: if you have an educational email email, you are elegible to have a Windows 10 Education license)
update: Windows 10 home is now supported but you need to update to 2004 release an enable wsl2.
-
In my opinion, the easiest way to install doccker in windows is using chocolatey
-
The second method to install directly from Dockerhub
-
A third alternative is to install a linux virtual machine (any distro) and install docker on it.
- you can install Docker from Dockerhub
The installation on Linux has variations according to the distribution, there is an installation page with instructions for the more pupular distributions.
After the installations you should run some configuration steps to secure your docker execution
A successfull docker installation can be tested in two ways:
- On a terminal execute
docker -v
ordocker --version
you should get an output like:
- On a terminal execute:
docker run hello-world
you should get an output like:
Now let's use an interactive nodeJs container, for this we will use the command: docker run -it node
. There is an example of couple of code lines.