This is a crosspost from adventofdocker.com
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
Top comments (0)