So you installed Docker yesterday but youβre still not quite sure what to do what it actually is?
Letβs start right from the beginning.
Docker is open-source software to isolate and package applications into containers. A container packages all required dependencies and libraries to run an application, which makes it easy to build and run your application in any environment. Each container is somewhat isolated from the others and from the host machine, but they still use the same operating system kernel, making them much more lightweight than a virtual machine. But this also means that they are not completely isolated from each other and from the host machine. This usually just means that you donβt want to run untrusted code in a Docker container π
The important thing to remember is for now, that Docker allows you to package your application into a container, which can be run in any environment that has Docker installed.
Some sidenotes
Docker is a company that maintains the Docker software and also offers a cloud service to run Docker containers in the cloud. They run DockerHub, which is a platform to store share and run Docker images. The actual standard for Docker containers is called OCI (Open Container Initiative). Because Docker is based on OCI there are many other tools that can interact with Docker containers, like Podman or Lima. If you want to go really deep, I really recommend reading the OCI specification! Itβs long but super interesting.
Why should I care?
If βyou can package your application into a containerβ doesnβt sound that exciting to you, let me give you some more concrete examples of what you can do with Docker.
Use Open Source Software
Most open source software these days is distributed as a container image. This means that you can just download the image and run it with Docker. No need to compile anything, no need to worry about dependencies. Just run it.
Postgres, MongoDB, you name it.
Share your software
If you ever wanted to share your software with someone, you probably know how annoying it is to get all the dependencies right. With Docker, you can just share the container image and they can run it with Docker. No need to compile anything, no need to worry about dependencies. Again, just run it. Last time you heard βIt works on my machineβ could be today π
Prevent Vendor Lock-In
Most cloud platforms support Docker containers. Sliplane, Fly.io, AWS, Google Cloud, etc. This means that you can easily switch between cloud providers if you want to, without having to change your software. If you ever migrated from one cloud provider to another, you probably know how much work this can be. With Docker, you can just take your container image and run it on the new platform.
Conclusion
Docker is a powerful tool that can help you share your software, use open source software and prevent vendor lock-in. Itβs a great tool to have in your toolbox and Iβm sure youβll find many use cases for it.
Now that you know what Docker is, we are ready to build our first container! But that is another topic for tomorrow.
Until then, happy coding! π
Jonas