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 2 of 8
How to run a command inside Docker Container?
After you build a Docker image and create a running instance of it (a Docker container), you might want to execute commands inside the container to install packages, browse directories, or perform various tasks. Docker provides several methods to access the container environment and execute commands. In this article, we will explore different ways to run commands inside Docker containers. Using Docker exec Command The docker exec command allows you to run commands in a running container from your local machine's command line. First, you need the container ID of the target container. Get Container Information ...
Read MoreHow does one remove a Docker image?
When working with Docker for extended periods, your local machine accumulates unused images from previous downloads, older versions, or testing purposes. These images consume significant disk space and can impact system performance. Additionally, dangling images (untagged images that are no longer referenced) contribute to storage bloat. Docker provides several commands to remove images efficiently: docker image rm, docker rmi, and docker image prune. Each command offers various options for strategic image removal, helping you maintain a clean Docker environment. Basic Image Removal Commands The primary command for removing Docker images is: $ docker image rm ...
Read MoreBuilding a full-fledged data science Docker Container
The combination of machine learning and containerization has revolutionized how data scientists develop and deploy applications. Organizations are rapidly adopting machine learning techniques to analyze data and improve customer satisfaction, while Docker containers provide a consistent, portable environment for development and deployment. In this article, we will build a comprehensive data science Docker container with all essential libraries and packages pre-installed. This containerized environment will help you get started with machine learning and data science projects quickly and efficiently. Essential Python Libraries for Data Science Before building our container, let's examine the core Python packages needed for ...
Read MoreHow is Docker different from a Virtual Machine?
When we speak about efficient utilization and proper allocation of computer resources, both virtual machines and Docker containers are effective in their own ways. In the past few years, Docker containers have gained tremendous popularity among organizations of all sizes. It is very important to understand the use-cases and purposes that they both serve if you want to decide which of the two is better for your requirements. However, before we start the discussion make sure that you have the basic knowledge of what Docker is. You can refer to our tutorial on Docker. So without any further ado, ...
Read MoreMaintain and Manipulate Docker Containers
Knowing how to create a dockerfile and build a docker image using that dockerfile, we can move ahead and dive deep into more advanced ways to manipulate docker containers. When we talk about manipulating docker containers, we include running, listing, restarting, cleaning up the dangling containers, running containers in interactive and detached modes, creating containers using executable images, executing commands inside docker containers using exec command and starting a bash inside a container, accessing logs from a docker container and killing or stopping a docker container. Without any further ado, let's dive deep into manipulating docker containers. Running ...
Read MoreHow to copy Docker images from one host to another without using a repository?
Docker images can be transferred from one host to another without using a repository like Docker Hub. While pushing to a registry is the standard approach, there are several alternative methods that allow direct image transfer between machines without creating accounts or managing repositories. These methods are particularly useful for offline environments, private networks, or when you need to quickly share images without internet access. Let's explore the most effective techniques for copying Docker images directly between hosts. Method 1 − Saving and Loading from TAR Files Docker provides built-in commands to export images as compressed TAR ...
Read MoreRunning 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 MorePython Library API for Docker
You can access, manage and manipulate docker objects such as containers, images, clusters, swarms, etc. using a Python library API. You can do pretty much anything that docker commands let you do. This comes very handy when you are using a python app such as Django or Flask and you want to maintain your docker container using the same python script that you use for the application. Installation To use the python library API for docker, you need to install a package called docker-py. You can do so using the following pip command. If you have python 2 ...
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 More