DEV Community

Cover image for Containerization with Docker 🐳
Josh
Josh

Posted on

Containerization with Docker 🐳

Hello everyone! This week I am going to go over containerization in docker and when it might be best to use it. For those that are familiar with virtual machines, containers have the same concept. Their purpose is to create an isolated environment that can be configured for a specific application. Since virtual machines and containers are similar I think it is important to explain the difference between them for those that aren’t familiar.

Virtual machines were developed first and they are essentially virtual computers that are ran on the same hardware. Each VM has it’s own OS and environment. It uses something called a hypervisor to manage the hardware resources between each VM. Disadvantages of a VM is that they are resource heavy and difficult to migrate between platforms.

Virtual Machine Diagram

Containers are similar to VMs in concept but the big difference is that they don’t include the OS in the container. This allows developers to create an environment for the application without including the resource heavy components of the VM. Unlike VMs, containers are easy to migrate between platforms with the same OS and are lightweight.

Docker Diagram

Containers do have their downsides though, some of which have to do with sharing the OS. Any security vulnerabilities introduced with one container that effects the OS will therefore affect all of the containers on the same machine. The containers are also initialized to work on a specific OS so if you want to migrate it, the new platform will need to be the same. With the positives and negatives weighed, the developer will need to consider what migration, resource, and security concerns will effect the application. Neither method is inherently better and will depend on the type of project.

I hope you all found this post helpful in understanding the basics of what containerization in docker is. Next week I plan on giving a tutorial for setting up and using docker. Please like and comment to let me know how I am doing and I hope you all have a great rest of your week. Happy coding!

Resources:

  1. https://docker-curriculum.com/#getting-started
  2. https://www.youtube.com/watch?v=JSLpG_spOBM
  3. https://www.netapp.com/blog/containers-vs-vms/
  4. https://www.redhat.com/en/topics/containers/containers-vs-vms

Discussion (0)