Found 120 Articles for Docker

How to run amd64 Docker images on the arm64 host platform?

Hemant Sharma
Updated on 28-Dec-2022 11:34:07

8K+ Views

Before knowing how to run amd64 docker images on the arm64 host platform, we must know what this means. There is a term called multi-architecture or multi-platform docker container images. These images contain the ability to run on various base or host architectures provided at the time of containerization of the images. Need of Multiplatform images Suppose you are a DevOps engineer and you have to prepare a web-server for an IT company. You have an amd64 host platform but when you handed over the image to the company you came to know that the company only works on the ... Read More

How to pass command line arguments to a python Docker container?

Hemant Sharma
Updated on 28-Dec-2022 11:23:23

12K+ Views

Before getting into the docker container arguments we must know about python command line arguments and how they are accessed by the developer. Command line arguments are of great use when we want our python script to be controlled outside of the program. Access the python script’s command line arguments Step 1: Create a python script main.py Example # sys will allow us to access the passed arguments import sys # sys.argv[0] access the first argument passed that is the python script name print("File or Script Name is :", sys.argv[0]) # print arguments other than the file name ... Read More

How to Hot-Reload in ReactJS Docker?

Hemant Sharma
Updated on 28-Dec-2022 11:17:20

9K+ Views

Hot-Reloading is adding dynamic functionality to the react application on the web browser. This means if we change something in the code of the application it immediately reflects this change on the web application front. But before “reloading” anything we must know “loading”, that is to make some ReactJs project on the Node Docker container. Creation and Containerization of React App Step 1: React app Use the prebuild commands to create a basic react application. Example $npx create-react-app reactapp Output npx: installed 67 in 19.076s Creating a new React app in /home/hemant/project/reactapp. Installing packages. This might take ... Read More

How does the Docker network work?

Hemant Sharma
Updated on 28-Dec-2022 11:14:15

285 Views

The best feature of Docker is “Containerization and Networking.” Using containerization, we could create an independent and isolated environment for various use cases like web applications (“Apache”), database servers (“MongoDB”), and operating systems (“Ubuntu”). But the Docker network allows us to connect these containerized applications to communicate with each other or to the host operating system. Types of Docker Network present on Docker Daemon There are two types of networks on Docker − Default Docker bridge network User−defined network Default Docker bridge network This network is created on the host operating machine as soon as the Docker ... Read More

What is the difference between the 'COPY' and 'ADD' commands in a Dockerfile?

Raunak Jain
Updated on 07-Aug-2021 06:03:32

444 Views

When you create a Dockerfile, you can use two different commands to build your context. Building a context means including the files and directories that you want from your local machine, to be in your container when it’s created. These files may be directories in your local machine, a URL from which you want to download files, or a compressed tarball file that you want to include as it is or after extracting the tarball file.We can use two different instructions to add the files from the build context in the local machine to the Docker container. These are the ... Read More

What is the difference between CMD and ENTRYPOINT in a Dockerfile?

Raunak Jain
Updated on 06-Aug-2021 12:37:11

3K+ Views

We can build Docker images by specifying instructions inside a Dockerfile. Dockerfile allows us to specify step-by-step instructions which define the rules for making a container environment. The Docker containers are created for specific tasks and processes to be run inside them. There are three important instructions that are used inside a Dockerfile which lets us define which processes need to be run inside the containers and in what sequence and order.These 3 instructions are -RUNCMDENTRYPOINTThe RUN instruction is quite simple. We can define simple subcommands along with the RUN instruction that we want to execute inside the container. For ... Read More

Vagrant vs Docker for creating an isolated environment

Raunak Jain
Updated on 06-Aug-2021 12:32:26

210 Views

Vagrant is a software that allows you to create a virtual machine that replicates the user's experience exactly as they want to set it up. Specifically, Vagrant allows you to test your application in a specific environment by mirroring the OS and all appropriate configurations.Whereas Docker is a framework that lets you containerize your app and build so-called microenvironments for deploying it without having to run a whole VM. Each container is a separate isolated environment that contains a unique application environment.As a result, programmers, testers, and DevOps engineers are able to spend less time debugging and identifying important bugs ... Read More

Running a Docker image as a container

Raunak Jain
Updated on 06-Aug-2021 12:29:16

480 Views

Docker allows you to create containerized, packaged, and isolated environments called Docker containers using Docker images. Inside these Docker containers, you can build, test, and even deploy your applications. This allows you to easily share your application run-time environment with other developers. All of this is possible because of a read-only template called Docker images.You can pull Docker images directly from any Docker registry such as Dockerhub or use a bse image inside a Dockerfile to build your own custom images. You can then use the Docker build command to build your Docker images. Once you have your Docker image ... Read More

How to remove old Docker containers?

Raunak Jain
Updated on 06-Aug-2021 12:20:46

546 Views

Docker allows you to remove old and stale containers that are of no use to you. You can use the Docker rm or Docker container rm commands to do so. However, before you start removing your containers, you need to make sure that none of your containers are actively running. In such a case, Docker will throw an error.However, there is another workaround to this. You can remove Docker containers forcefully using the --force option as well. The Docker remove commands allow you to remove one or more Docker containers together. You just need to specify the container IDs or ... Read More

How to list images in Docker?

Raunak Jain
Updated on 06-Aug-2021 12:18:02

6K+ Views

Docker provides a plethora of useful Docker commands that will help you to create, manipulate, and manage Docker objects such as volumes, images, containers, networks, etc. If you have been working with Docker for a long time now, you might have several Docker images already in your machine. Keeping track of all these images becomes quite difficult especially through a single command line.However, you can list all Docker images along with filtered outputs to get your desired results. In this article, we will discuss how to use different commands along with multiple options to list all Docker images in our ... Read More

Previous 1 ... 5 6 7 8 9 ... 12 Next
Advertisements