Hemant Sharma has Published 37 Articles

What is the purpose of VOLUME in Dockerfile?

Hemant Sharma

Hemant Sharma

Updated on 14-Sep-2023 14:04:20

30K+ Views

Introduction Docker is a popular containerization platform that allows users to package and deploy applications in a standardized and isolated environment. Docker uses a file called a Dockerfile to specify the instructions for building and running a Docker container. One important element of a Dockerfile is the VOLUME instruction, ... Read More

How to save all Docker images and copy to another machine?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:55:11

4K+ Views

Introduction Docker images are the building blocks of containerized applications. They are lightweight, portable and can be easily shared between different machines. In this article, we'll take a look at how to save all Docker images on one machine and transfer them to another machine. Method 1: Using docker save ... Read More

How to flatten a Docker image?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:53:46

3K+ Views

Introduction Flattening a Docker image is the process of creating a new, single-layer image from an existing multi-layer image. Flattening an image can be useful in a variety of scenarios, such as reducing the size of the image, improving the performance of the image, or simplifying the image for easier ... Read More

How to execute a script when I terminate a Docker container?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:52:30

1K+ Views

Introduction Executing a script upon container termination is the process of running a script or command when a Docker container is stopped or removed. This can be useful in a variety of scenarios, such as cleaning up resources, logging information, or triggering other actions. Container termination refers to the process ... Read More

How to cache the RUN npm install instruction when docker builds a Dockerfile?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:50:57

6K+ Views

Introduction When building a Docker image, one of the most time-consuming and resource-intensive steps is running the "RUN npm install" instruction. This instruction installs all the dependencies listed in your package.json file. Caching the results of this instruction can greatly improve the build time of your image. In this article, ... Read More

How many CPUs does a docker container use?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:49:08

12K+ Views

Introduction Docker containers are a popular way to package and deploy applications. One of the key features of containerization is the ability to isolate resources and limit their usage. In terms of CPU, it is important to know how many CPUs a container can use, as this can greatly impact ... Read More

How can I use a variable inside a Dockerfile CMD?

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:46:01

7K+ Views

Introduction Using variables in a Dockerfile CMD can greatly improve the flexibility and maintainability of container configuration. Hardcoding values in a CMD instruction can make it difficult to update or modify the container's configuration in the future. Using variables allows for more dynamic and reusable configurations. Prerequisites The prerequisites for ... Read More

Docker add network drive as volume on windows

Hemant Sharma

Hemant Sharma

Updated on 17-Feb-2023 14:40:46

7K+ Views

Introduction When working with Docker on Windows, it is possible to use network drives as volumes. This allows you to store data on a network drive and access it from within a Docker container. This can be useful in situations where you need to share data between containers, or between ... Read More

Protect the Docker daemon socket

Hemant Sharma

Hemant Sharma

Updated on 30-Jan-2023 10:06:29

427 Views

Introduction The Docker daemon is a background process that manages Docker containers and is responsible for the creation, execution, and deletion of containers. One key component of the Docker daemon is the Docker daemon socket, which is used to communicate with the daemon from the Docker CLI and other applications. ... Read More

How to run splash using Docker toolbox?

Hemant Sharma

Hemant Sharma

Updated on 30-Jan-2023 10:01:12

294 Views

Introduction Splash is a powerful tool for rendering JavaScript-based websites, making it an essential tool for web scraping and data extraction. In this tutorial, we will show you how to run Splash using Docker Toolbox, an older version of Docker that is no longer being maintained but is still available ... Read More

Advertisements