Hi, some time ago I was a guest on a podcast “Pierwsze kroki w IT” about docker. I would like to thank Mateusz Bogolubow from devmentor.pl for the invitation and the conversation.
During the podcast I was faced with very interesting questions, which I tried to answer as best I could. In the end, we created a very good material, talking about “What is Docker”, containers and virtualization. We talked about how virtualization differs from containers, what are the pros and cons of both solutions. We discussed the basic concepts of images, containers and image registry. We explained how containers work on a practical example of a website created on WordPress.
This article is just part of a podcast talking about what docker can be useful for when you’re learning programming. In the podcast, we talked about how you can get started with containers and gave plenty of advice, warned about common mistakes and told you when it’s better not to use containers.
Part of the conversation can be found below, and the entire podcast in Polish can be found on:
- YouTube – Co to jest Docker | Pierwsze kroki w IT #56 [ IT podcast ] – YouTube
- Spotify – Co to jest Docker – Pierwsze kroki w IT | Podcast on Spotify
- Google Podcast – Pierwsze kroki w IT – Co to jest Docker (google.com)
- Apple Podcast – Pierwsze kroki w IT: Co to jest Docker on Apple Podcasts
- devmentor.pl – Co to jest Docker – devmentor.pl
Docker can be used for what when learning programming?
Wojtek – Docker will allow you to do what you care about. When you want to learn programming, you focus on learning programming, you don’t have to spend time installing database and other things. You don’t have to deal with installation, configuration, etc. because Docker images may already have it all done. You just run it and it works. You focus on learning programming or whatever you want to learn.
You choose a container that has what you need installed, in the version you need – and that’s it. You need a newer or older version, then you don’t bother installing or updating, you just choose a different one image and you’re done.
works. But if you have a back-end language, for example PHP, then you have to install at least PHP, Apache, some database to be able to start working at all. It’s a little easier with the front end, and you have to play with the back end a bit to get started. And that’s it, you can continue. Forgive me for interrupting you.
Wojtek – Sure, no problem.
Wojtek – The cool thing about it is that it helps keep your computer organized – you don’t have to install a ton of stuff and every now and then add something, remove something, change versions, etc., because you have it in a container. You won’t have junk on your computer and you won’t have to wonder what version you have currently installed.
Of course, sometimes virtual machines will be a better choice – depending on what you need. Just remember that it takes a little more work to prepare and configure such a virtual machine. When you make a mistake and want to start from scratch, it will take more time. And what if you need to run several virtual machines at the same time? Then your laptop won’t be happy. Containers have the advantage of being lighter and, as we mentioned earlier, they don’t use as many resources.
What’s also great is that when you play around on such a container and break something, you don’t worry about it. You just reboot it and start from the beginning. I’ve often met people who installed software on their laptops and tried to learn something, only they often ended up having to reinstall the system after their attempts because something went wrong. Then they came up with the idea that they would make a backup before they started working, and when something went wrong, they would go back to it – but that usually takes a long time. A much better solution is containers. When something goes wrong, you restart the container and start over, and when everything works, you can create a new image and start from where everything works.
Mateusz – I might add something. It’s been a while, but I had PHP version 4-something, 5.0, 5.6, and then I was already lost, what’s where, if it works or doesn’t work, why it doesn’t work, here ports some blocked. Aj… It would certainly make a lot easier. OK, that’s it. please continue.
Wojtek – Just remember to name these images correctly, so that later you will know what is in which image.
Mateusz – Yes, it is.
Wojtek – Here I would like to add that containers can also access files from our computer. Thanks to this, after restarting the container, our work will not disappear. We can share files that will be the web application code. We can run applications using e.g. an HTTP server, of course in a container, and use it normally. The same goes for the database: we don’t need to stuff it into a container. The database files can be on our disk and we can share them in the container using special volumes as in the previous example.
More information about Docker
If you are curious what happened next, you can watch the whole podcast in Polish on Youtube. Get ready for a solid dose of knowledge because the podcast lasts almost an hour.
If you enjoyed the Docker podcast, you might also be interested in the podcast “Introduction to DevOps”.