Image history – Creating and Managing Container Images

To understand images and their layers, you can always inspect the image history. Let’s inspect the history of the last Docker image by running the following command: As you can see, there are several layers, and every layer has associated commands. You can also see when the layers were created and the size of the […]

Read More… from Image history – Creating and Managing Container Images

The layered filesystem – Creating and Managing Container Images

Layers in Docker are intermediate Docker images. The idea is that every Dockerfile statement we execute on top of a layer changes something within the layer and builds a new one. The subsequent statement modifies the current one to generate the next one. The final layer executes the Docker CMD or ENTRYPOINT command, and the […]

Read More… from The layered filesystem – Creating and Managing Container Images

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

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

Challenges with container monitoring – Containerization with Docker

From a conceptual point of view, there is no difference between container monitoring and the traditional method. You still need metrics, logs, health checks, and service discovery. These aren’t things that are unknown or haven’t been explored before. The problem with containers is the abstraction that they bring with them; let’s look at some of […]

Read More… from Challenges with container monitoring – Containerization with Docker

Logging drivers – Containerization with Docker

Docker logging and logging drivers Docker not only changed how applications are deployed but also the workflow for log management. Instead of writing logs to files, containers write logs to the console (stdout/stderr). Docker then uses a logging driver to export container logs to the specified destinations. Container log management Log management is an essential […]

Read More… from Logging drivers – Containerization with Docker

Putting it all together – Containerization with Docker

The best setting for a highly available NGINX container should be something like the following: $ docker run -d –name nginx –restart unless-stopped \ -p 80:80 –memory 1000M –memory-reservation 250M nginx:1.18.0 Let’s take a look at this in more detail: We will look into other flags in the subsequent sections as we get more hands-on. […]

Read More… from Putting it all together – Containerization with Docker