Found 48 Articles for Virtual Machines

How to get Docker containers to talk to each other while running on my local host?

Hemant Sharma
Updated on 05-Jan-2023 15:41:05

10K+ Views

Introduction Connection in Docker container can be made using various ways. Some of these are explained in this article. Docker networking using the command line interface and docker-compose. This networking leads to communication between the containers. Pre-requisites Install the below prerequisites before executing the commands. Docker Engine Docker compose Methods These methods are simple and easy to implement on the local machine. Using CLI commands Using Docker Compose Using Command Line Interface Here we are going to create two different containers and connect them using the docker networking features. Step 1: Create a Docker network $ ... Read More

How to determine if a process runs inside lxc/Docker?

Hemant Sharma
Updated on 05-Jan-2023 15:40:36

478 Views

Introduction The main goal of this article is to find out the if the process is on the container. We have discussed several methods that could help us to filter out the non-container machine from the container once. Simple commands and some special kernel files are used to conclude our point. Pre-requisite To implement the complete article on your setup machine, you need to have the below-listed prerequisites − Linux OS: Ubuntu Docker Daemon and Client Methods Some of the methods that help identify the machine are listed below. The machine could be a container or a ... Read More

How to add Credentials to Docker ADD command?

Hemant Sharma
Updated on 05-Jan-2023 15:40:00

4K+ Views

Introduction Security has always been a great threat to mankind. In IT the security of credentials is a tedious task. Here, we are going to discuss various methods to add the credentials to the docker container. Also, the most useful and secure methods are mentioned. Methods Adding credentials can be done in a lot of different ways. Some of the types are mentioned below. Each method has its place in the industry. Some are just rejected by the developers due to security issues and some works very well in the case of credential security. Using the Build ... Read More

How to run Gunicorn on Docker?

Hemant Sharma
Updated on 28-Dec-2022 11:30:25

6K+ Views

In this article, we are going to learn about how to run Gunicorn on Docker. Before creating the docker container with the gunicorn functionalities, we must know some of the basics of web servers and gunicorn. Introduction to Gunicorn Let us suppose we have a web server that shows the output of a python code to the users. This web server will execute the python script each time a request came to it, this will cause it to restart, overload, and delay (heavy delay for huge scripts) in response. So the real problem here we have is a static server ... Read More

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

281 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

Advertisements