What is a (docker) container?
Tags: cloud, aws, cloudplatform, docker
Published: 2023-03-21 18:33:49

---
title: What is a (docker) container?
published: true
date: 2023-03-13 14:07:00 UTC
tags: cloud,aws,cloudplatform,docker
canonical_url: https://greenido.wordpress.com/2023/03/13/what-is-a-docker-container/
---

Docker is an open-source platform for developing, shipping, and running applications. A containerization technology allows you to package applications and their dependencies into isolated containers that can be easily deployed and managed. Docker containers provide a lightweight, portable, and secure way to run applications in various environments. In the past, I [wrote](https://dev.to/greenido/run-everything-in-docker-containers-on-your-mac-3b9b) about it a few [times](https://greenido.wordpress.com/tag/docker/).

## Pros

**Portability** : Docker containers are highly portable and can be deployed on any platform that supports Docker. This makes it easy to move applications between different environments, such as development, staging, and production.

- **Isolation** : Docker containers are isolated from each other and the host system, which provides a secure environment for running applications.
- **Scalability** : Docker containers can be scaled up or down quickly and easily, allowing you to adjust the resources allocated to an application.
- **Efficiency** : Docker containers are much more efficient than virtual machines, as they use fewer resources and can be deployed more quickly.
- **K8B** – The revolution of kubernetes is also one advantage of leveraging containers. It’s another topic, but you can get a sense of the power by [running K8B on your MacOS](https://dev.to/greenido/your-first-kubernetes-cluster-on-mac-2c1n).

## Cons

- **Security** : Docker containers are not as [secure](https://blog.aquasec.com/docker-security-best-practices) as virtual machines, as they are more exposed to the host system.
- **Resource**  **Management** : Docker containers can be challenging to manage, as they require manual configuration and can be difficult to monitor.
- **Cost** : Docker containers can be more expensive than virtual machines, as they require additional hardware and software resources.

## Leveraging Docker

Docker containers can be a great way to quickly deploy and manage applications in various environments.   
Here are some tips for leveraging Docker in your next project:

### Automate Deployment

- Use Docker to automate the Deployment of your application in different environments. This will save you time and ensure your application is deployed consistently across all environments (e.g., dev, test, production). You can check GCP, AWS, and other blogs on the best practices to do it. 
- Once you run the first one, you will be happy you invested in your Terraforms infra in order to create a template.
- **Use Configuration Management Tools** : Use configuration management tools such as Ansible, Chef, or Puppet to automate the deployment process. This will help you quickly deploy your application in different environments without manually configuring each one separately.
- **Integrate With CI/CD Pipelines** : Integrate your deployment process with Continuous Integration (CI) and Continuous Delivery (CD) pipelines so that changes can be automatically deployed when they are made. This will help ensure that any new features or bug fixes are quickly deployed across all environments.   
Psst! (pro tip) –> You might want to check JFrog platform.
- **Monitor Performance** : Monitor the performance of your application after deploying it in different environments to ensure it is running optimally. This will help you identify any potential issues quickly and take corrective action if needed.

### Optimize Resources

Use Docker to optimize the resources allocated to your application. This will help ensure that your application runs efficiently and only consumes a few resources. Services like [AWS Lambda](https://aws.amazon.com/lambda/) are not only cheap (relatively) but also give you the best ROI when it comes to cloud-native applications.

### Monitor Performance

Use Docker to monitor the Performance of your application in different environments. This will help you identify potential issues and ensure that your application runs optimally.

### Secure Your Application

Use Docker to isolate your application from the host system.   
This will help protect your application from malicious attacks and keep it secure. Here is an idea from the past on [‘How to run everything inside a container in your MacOS’](https://dev.to/greenido/run-everything-in-docker-containers-on-your-mac-3b9b).

## What to learn more?

If you wish to get answers to questions like:

- What is a container? 
- Is it really a “lightweight VM”? 
- What are namespaces and control groups? 
- What does a host machine know about my containers? 
- What do my containers know about each other?

Here is an excellent talk from Liz Rice:

<iframe width="696" height="392" src="https://www.youtube.com/embed/8fi7uSYlOdc?version=3&amp;rel=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;fs=1&amp;hl=en&amp;autohide=2&amp;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>

Bottomline, by leveraging Docker in your next project, you can quickly deploy and manage applications in different environments, optimize resources, monitor performance, and secure your application. Plus, it will be cheaper (in most cases).  
Good luck.