Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Raunak Jain
Page 3 of 8
Running a static site on Apache Server from Docker
Docker containers are widely used in development workflows for building, distributing, testing, and deploying applications. They enable developer collaboration, version management, and local testing by hosting applications on containerized servers. This article demonstrates how to run a static website on an Apache server inside a Docker container and access it through your local browser. A static website consists of HTML, CSS, and minimal JavaScript without dynamic content rendering. Project Structure First, create the following directory structure − project-folder/ ├── Dockerfile └── mysite/ └── index.html Creating the Static Website ...
Read MoreHow to use an OVS Bridge for Networking on Docker?
OVS bridges or Open vSwitch bridges are used as an alternative to the native bridges in Linux. They support most features found in physical switches while also supporting multiple VLANs on a single bridge. OVS is widely used in Docker networking because it provides enhanced multi-host networking capabilities and more secure communication compared to native bridges. In this article, we will discuss how to perform Docker networking using Open vSwitch bridges (OVS). We will cover the installation of OVS and the OVS utility for Docker, create an OVS bridge, connect two Docker containers to the bridge, and test the ...
Read MoreBuild a flask App using Docker Compose
Docker Compose allows you to build multi-container Docker applications. If you are working on a microservice project where you have different nodes working on different parts of the project, Docker Compose is exactly what you need. Using Docker Compose, you can work on different components of the project on different Docker containers and combine them to create a single application. In this article, we are going to discuss how to build a Flask application which uses Python modules and we will try to run it inside a Docker container using Docker Compose. Installing Docker Compose First, you ...
Read MoreHow to copy files from host to Docker container?
If you have a Docker container running and you want to copy files from the host machine to the Docker container, there are several ways to do it. One way to do this is by using the ADD or COPY instructions inside a Dockerfile and passing the paths of the files that you want to be in your container when you start it. But what happens if you already have a container running? It's not feasible to build the same image again and again just for a small file to be included in it. To avoid this fiasco, Docker ...
Read MoreCreate a simple Numpy Jupyter Notebook using Docker
Machine learning and Data Science have become essential technologies in modern computing. Organizations adopt Data Analytics and Machine Learning techniques to predict sales and increase revenue. If you want to build machine learning models in a dynamic and contained environment, Docker containers provide an excellent solution. You can build and run Machine Learning models easily inside Docker Containers with the help of Jupyter Notebooks. The containerized environment provides better version control of your Python or R libraries and packages used in Machine Learning projects. In this article, we will discuss how to create a simple NumPy Jupyter Notebook ...
Read MoreWorking with Docker Swarm
Docker Swarm is a container orchestration tool that enables you to manage a cluster of Docker nodes as a single virtual system. It provides native clustering functionality for Docker containers, allowing you to deploy and scale applications across multiple machines while maintaining high availability and load balancing. In a Docker Swarm cluster, there are two types of nodes: manager nodes that control the cluster and make orchestration decisions, and worker nodes that run the actual containers. The swarm manager handles scheduling, load balancing, and service discovery automatically. Docker Swarm operates in two service modes: Replicated Service mode where ...
Read MoreHow to deal with persistent storage (e.g. databases) in Docker?
Docker volumes provide a robust solution for persistent storage in Docker containers. Unlike bind mounts, which depend heavily on the host's directory structure, volumes are completely managed by Docker and offer better portability and control. When using volumes, Docker creates a new directory within its storage directory on the host machine. This approach is superior to persisting data on the container's writable layer because volumes don't increase container size and their contents exist independently of the container's lifecycle. Advantages of Docker Volumes Portability − Easier to migrate or back up across different environments Management − Simple ...
Read MoreDocker host network vs bridge network
Docker provides two primary single-host networking modes: host and bridge networks. Single-host networks operate locally on each individual Docker host, providing different levels of network isolation and connectivity options. In host networking, Docker containers share the host's network stack directly, eliminating network isolation between container and host. With bridge networking, containers run in an isolated network namespace and require explicit port mapping to communicate with external systems. Host Network Mode Host networking allows containers to use the host's network interface directly. This mode provides maximum performance but sacrifices network isolation. Creating a Container with Host Network ...
Read MoreHow to edit a file after I shell to a Docker container?
When working with Docker containers, you may need to edit files directly inside the container after accessing its shell. This is common during debugging, configuration changes, or quick fixes. There are multiple approaches to achieve this, depending on whether you need a temporary solution or want to prepare an image with pre-installed editors. Accessing a Container Shell First, you need to access the container's shell. There are two main scenarios: Creating a New Container with Shell Access To create and run a new Ubuntu container with interactive shell access: $ docker run -it --name=mycont ...
Read MoreUser defined bridge on Docker network
A user-defined bridge network in Docker provides enhanced networking capabilities compared to the default bridge network. It allows containers to communicate using container names instead of IP addresses, offers better isolation, and provides more flexible network management options. Advantages of User-Defined Bridge Networks User-defined bridge networks offer several key benefits over default bridge networks: Name-based communication − Containers can access each other using names or aliases instead of IP addresses Better isolation − Only containers within the same user-defined network can communicate with each other Dynamic connectivity − Containers can be connected or disconnected from networks ...
Read More