Docker Articles

Page 2 of 12

Top tips to manage docker containers from command line

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 368 Views

Docker has become the standard for containerization, with organizations rapidly adopting container-based architectures. Managing multiple containers and images through the command line interface (CLI) can seem overwhelming, but with the right set of commands and techniques, it becomes straightforward and efficient. This article covers essential tips and commands for managing Docker containers and images from the command line, helping you streamline your container operations and save valuable time. Listing Images and Containers Keeping track of your Docker resources is crucial for effective management. Use these commands to view your current images and containers. List All Images ...

Read More

Best practices for writing a Dockerfile

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 414 Views

A Dockerfile is a text document containing instructions to build a container image. It allows developers to create reproducible execution environments and automate the deployment process. Writing an efficient Dockerfile is crucial for project performance, especially when deploying at scale. Docker images follow a layered architecture where each instruction creates a new layer. This design enables image reuse, efficient disk storage utilization, and caching during the build process. Understanding this layered structure is key to optimizing your Dockerfile. Docker Image Layer Structure Application Layer ...

Read More

Using .Dockerignore file

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 5K+ Views

We know that we can run our docker images on cloud services which provide high computations at low cost. However, one might wonder why we need to optimize a docker image. Think of a situation where you have copied a large file in your docker container that you actually don't need. It will obviously increase the size of the docker image, increase the overall build time, and cause caching issues. So, why not use a simple technique to avoid all these issues and improve the overall performance of the docker build process. What is a .dockerignore file? Similar ...

Read More

Running GUI applications on docker in linux

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 664 Views

Running GUI applications inside Docker containers requires connecting the container's display output to the host system's display server. By default, Docker containers cannot access the host's display, making it impossible to run graphical applications. This article demonstrates how to configure Docker containers to run GUI applications like Firefox by forwarding X11 sockets and managing display permissions. X11 Display Forwarding The X11 display server handles graphical output on Linux systems. To run GUI applications in Docker, we need to: Forward the X11 socket to the container Set the DISPLAY environment variable Configure X server authentication permissions ...

Read More

RUN vs CMD vs Entrypoint in Docker

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 5K+ Views

The commands RUN, CMD, and ENTRYPOINT usually cause a lot of confusion among Docker developers. Understanding all three commands conceptually will help to have a clearer understanding of Docker image building and container execution. When we try to build an image using a Dockerfile, the instructions are executed step by step. The first instruction is usually pulling a base image such as an OS distribution like Ubuntu or CentOS. After that, we modify the base image either by including more images using FROM and AS commands or by modifying the images. Every such instruction creates a new intermediate image ...

Read More

Combine multiple images using one dockerfile

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 5K+ Views

When you are working on a large project with Docker, you need to go through certain phases of the development cycle. Maintaining a different dockerfile for each cycle such as build, release, testing etc. consumes significant resources and reduces productivity efficiency. In later versions of Docker, multi-stage Dockerfile functionality allows us to use multiple images in a single Dockerfile with the help of two particular commands − FROM and AS. How Multi-Stage Dockerfiles Work We can use multiple FROM commands combined with AS commands in our Dockerfile where the last FROM command builds the final image. All ...

Read More

Installing Linux Packages Inside a Docker Container

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 4K+ Views

Docker containers provide an isolated environment for running applications. After installing Docker on your Linux machine, you can create custom images by starting with a base OS image and adding packages. This article demonstrates how to install packages inside a Docker container using Ubuntu as the base image. We'll install three essential packages: vim editor, Firefox, and Python 3.7. There are two approaches to accomplish this − using CLI commands step-by-step or creating a Dockerfile for automated builds. Method 1 − Step-by-Step CLI Approach Running the Base Ubuntu Container First, pull and run the Ubuntu image ...

Read More

Mounting a volume inside docker container

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 1K+ Views

Docker volumes provide a way to create shared storage that persists beyond the lifecycle of individual containers. When you have multiple containers that need to share common files, mounting a volume allows all containers to access and modify the same data from a centralized location. This approach is particularly useful in microservices architectures where different containers handle different parts of an application but need to share configuration files, logs, or data files. By mounting a volume to multiple containers, you create a shared filesystem that remains available even when individual containers are stopped or removed. Creating and Managing ...

Read More

Copy Files from Docker Container to Local Machine

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 3K+ Views

If you are working on a project that requires frequent copying of files and folders either from container to your local machine or from the local machine to the container, Docker provides an easy and simple way to do that. If you have already built a Docker image which is of large size and contains a large number of files and in the midst of the project you want to copy files to and from the container, it's highly inefficient to put the files in the Docker build context and build images repeatedly. Instead, Docker allows easy copying of files ...

Read More

How to backup and restore a Docker Container?

Raunak Jain
Raunak Jain
Updated on 17-Mar-2026 3K+ Views

Docker containers provide a packaged environment for applications, making them portable and lightweight while allowing version control. Sometimes you need to create snapshots or backups of running containers for emergency rollbacks or to preserve specific states. This article covers how to backup and restore Docker containers using built-in commands. Note: The backup methods described here work for containers with embedded data. For containers using separate data volumes, you must create separate backups for each volume. Backing up a Docker Container The backup process involves creating a snapshot of the container's current state and saving it as an ...

Read More
Showing 11–20 of 111 articles
« Prev 1 2 3 4 5 12 Next »
Advertisements