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
Docker Articles
Page 4 of 12
Build 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 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 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 MoreRunning Docker Container as a Non Root User
When you run an application inside a Docker Container, by default it has access to all the root privileges. You might have noticed that when you open an Ubuntu Docker Container bash, you are logged in as the root user by default. This can prove to be a major security concern for your application. Any unauthorized access can compromise the entire container along with all the files and applications running inside it. Hence, it becomes very important to perform operations as a non-root user wherever possible. In this article, we will discuss two methods to run Docker containers as ...
Read MoreTop skills that would be handy before taking up a technical role
Getting through all the tedious interview rounds of big tech giants for internships and jobs is in itself a big task. But once you clear the interview rounds and secure a job or an internship, the journey does not end there. In fact, this will be the time you need to upskill yourself in order to keep up with the pace of shift in technological stacks that the tech industry goes through. In this article, we will be discussing top skills that would be very handy if you would learn it before taking up the job or internship position. ...
Read MoreCopying files from Docker container to Host
We can use the Docker build command to build Docker images using a build context. The build context contains all the files which are required to create your containerized application environment. This includes the Dockerfile to build the Docker images, source code of the application, Dockerignore files, all the files, and directories that you want to be there beforehand in the container when you run it. However, it often happens that you might want to copy some files from the container to the host machine. For example, if you are working on an application inside a Docker container and ...
Read MoreFrom inside of a Docker container, how do I connect to the localhost of the machine
When running applications in Docker containers, you often need to connect from the container to services running on the host machine's localhost. For example, if you have an Nginx container that needs to access a MySQL database running on your host's localhost (127.0.0.1), the default container networking won't allow this connection since the container has its own isolated network namespace. This article explains different methods to establish connectivity between Docker containers and host services, with solutions varying by operating system and networking requirements. Method 1 − Host Network Mode (Linux) The simplest solution on Linux is using ...
Read MoreHow do I get into a Docker container's shell?
Docker containers provide isolated environments for applications, and accessing their shell is essential for debugging, testing, and interactive work. Once you have a Docker container, you can work with its environment just like an Ubuntu machine − execute commands, explore the file system, and deploy applications. There are three primary methods to access a Docker container's shell, depending on the container's current state and your specific needs. Method 1: Docker Run Command Use this method when you want to create and run a new container with immediate shell access. The docker run command creates a container from ...
Read MoreHow do I pass environment variables to Docker containers?
Suppose you are using a MySQL Docker container and you want to pass environment variables to your container while running the container. It's always a good idea to isolate the services from the configuration and it's always advised to use environment variables for this purpose. Predominantly, there are three different ways through which we can pass environment variables to our Docker containers. These are by using the -e, --env-file, and the ENV instruction inside the Dockerfile. Let's check out all these methods one by one with examples. Passing Environment Variables Using the --env or -e Flag To ...
Read More