Docker architecture – Creating and Managing Container Images-2

So, Docker is like your magical kitchen where you make dishes (containers) using plans (Dockerfiles) and ingredients (images) with the assistance of your kitchen helpers (Docker Engine). You can even serve entire meals (Docker Compose) and use special storage areas (volumes) and communication paths (networks) to make your dishes even more amazing. Just like a […]

Read More… from Docker architecture – Creating and Managing Container Images-2

Docker architecture – Creating and Managing Container Images-1

Imagine you’re a passionate chef dedicated to creating mouthwatering dishes that satisfy hungry customers. In your kitchen, which is a magical place called Docker, you have special powers to plan, make, and showcase your culinary creations. Let’s break down the key parts: Ingredients (Application Code and Dependencies): Imagine your kitchen has shelves filled with ingredients […]

Read More… from Docker architecture – Creating and Managing Container Images-1

Technical requirements – Creating and Managing Container Images

In the previous chapter, we covered containerization with Docker, where we installed Docker and ran our first container. We covered some core fundamentals, including Docker volumes, mounts, storage drivers, and logging drivers. We also covered Docker Compose as a declarative method of managing containers. Now, we will discuss the core building blocks of containers: container […]

Read More… from Technical requirements – Creating and Managing Container Images

Be mindful of dependencies in production – Containerization with Docker

Use an .env file to store sensitive variables You might not want to store sensitive content such as passwords and secrets in version control. Instead, you can use an .env file that contains a list of variable names and values and keep it in a secret management system such as HashiCorp Vault. Be mindful of […]

Read More… from Be mindful of dependencies in production – Containerization with Docker

Separate multiple environment YAMLs using overrides – Containerization with Docker

Docker Compose best practices Docker Compose provides a declarative way of managing Docker container configuration. This enables GitOps for your Docker workloads. While Docker Compose is primarily used in development environments, you can use it in production very effectively, especially when Docker runs in production and does not use another container orchestrator such as Kubernetes. […]

Read More… from Separate multiple environment YAMLs using overrides – Containerization with Docker

Creating the docker-compose file – Containerization with Docker

The next step in the process is to create a docker-compose file. A docker-compose file is a YAML file that contains a list of services, networks, volumes, and other associated configurations. Let’s look at the following example docker-compose.yaml file to understand it better: version: “2.4” services: flask: image: “bharamicrosystems/python-flask-redis:latest” ports: networks: redis: image: “redis:alpine” networks: […]

Read More… from Creating the docker-compose file – Containerization with Docker

Docker container metrics – Containerization with Docker

Metrics to monitor Monitoring metrics is a complex subject, and it would depend mostly on your use case. However, the following are some guidelines on what metrics you want to monitor. Host metrics You need to monitor your host metrics as your containers run on them. Some of the metrics that you can watch are […]

Read More… from Docker container metrics – Containerization with Docker

Configuring Prometheus to scrape metrics – Containerization with Docker

We will now configure Prometheus on the Prometheus machine so that it can scrape the metrics from cAdvisor. To do so, modify the /etc/prometheus/prometheus.yml file so that it includes the following within the server running Prometheus: $ sudo vim /etc/prometheus/prometheus.yml … scrape_interval: 5s static_configs: After changing this configuration, we need to restart the Prometheus service. […]

Read More… from Configuring Prometheus to scrape metrics – Containerization with Docker

Troubleshooting containers – Containerization with Docker

To see what’s going on within the container, you can use the docker logs command. But before using that, we need to know the container’s ID or name to see the container’s logs. To get a list of containers running within the host, run the following command $ docker ps           […]

Read More… from Troubleshooting containers – Containerization with Docker

Running your first container – Containerization with Docker

You can create Docker containers out of Docker container images. While we will discuss container images and their architecture in the following chapters, an excellent way to visualize them is as a copy of all files, application libraries, and dependencies comprising your application environment, similar to a virtual machine image. To run a Docker container, […]

Read More… from Running your first container – Containerization with Docker