Found 1383 Articles for Open Source

How to manage secret values with docker-compose v3.1?

Diksha Patro
Updated on 17-Jan-2023 18:24:41

2K+ Views

Introduction As developers, we frequently need to incorporate private data into our applications, including passwords, API keys, and database credentials. Not only is it unsafe to hardcode these variables into our code or configuration files, but it can also be challenging to manage and change them when necessary. Using environment variables, which let us keep sensitive data apart from our codebase and configuration files, is one method to manage secret values. In this article, we'll look at how to maintain secret values using docker-compose v3.1 and inject them as environment variables into our containers. Prerequisites To follow along with this ... Read More

How to Improve Docker Image Size With Layers?

Diksha Patro
Updated on 17-Jan-2023 18:22:20

244 Views

In this article, we will discuss various approaches and techniques for improving Docker image size with layers, including multi-stage builds, using minimal base images, and using base images with pre-installed packages or pre-built binaries. By following these best practices, we can create smaller and more efficient Docker images that are optimized for performance and scalability. The size of Docker images with layers can be improved using a variety of methods as given below. Methods Using minimal base images Using base images with pre-built binaries Using multi-stage builds Using base images with pre-installed packages Let us discuss these methods ... Read More

How to Find the layers and layer sizes for each Docker image?

Diksha Patro
Updated on 17-Jan-2023 18:14:29

6K+ Views

Introduction By using containerization, we can quickly set up and configure our deployment environments, which helps us save time and resources. With the goal of "write once, deploy anywhere" in mind, containerization can help us streamline the process of deploying modern applications, which can be complex. Finding the layers and layer sizes for Docker images In this article, we will explore how to find the layers and layer sizes for each Docker image. This can be useful for identifying large layers that may be contributing to the overall size of the image, and for determining which layers can be removed ... Read More

How to find Docker container processes?

Diksha Patro
Updated on 17-Jan-2023 18:11:05

11K+ Views

Introduction Docker is a powerful tool that allows developers to build, ship, and run applications inside containers. Containers are small, independent executable packages that contain all the components - code, libraries, dependencies, and runtime - that an application requires to function. One of the key features of Docker is the ability to manage and monitor the processes running inside containers. In this article, we will explore how to find Docker container processes and how to use different methods to view and manage them. Prerequisites You will need Docker installed on your computer in order to follow along with this guide. ... Read More

How to directly mount NFS share/volume in a container using Docker Compose v3?

Diksha Patro
Updated on 17-Jan-2023 17:53:10

7K+ Views

Docker is a widely used tool for developing and managing containerized applications. It enables programmers to combine their applications with their dependencies into small, portable containers that are simple to set up and use on any platform. Directly mounting Network File System (NFS) shares or volumes inside a container using Docker Compose v3 is one practical Docker capability. In this article, we will explore how to use Docker Compose v3 to directly mount an NFS share or volume in a container. Method to directly mount NFS share/volume in the container using Docker Compose v3 Here are some important terms and ... Read More

Keeping SSH session alive on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:13:39

12K+ Views

Introduction Secure Shell (SSH) is a network protocol that allows secure remote connections between two systems. It is commonly used to access and manage Linux servers remotely. However, one of the problems with using SSH is that your session can be terminated due to downtime or network outages. This can be frustrating, especially if you're working on a long-running task that requires an uninterrupted connection. In this article, we will discuss various methods of keeping an SSH session alive on Linux. Using the ClientAlive Interval Option One way to prevent an SSH session from closing due to inactivity is to ... Read More

Writing Text to File Using Linux Cat Command

Pradeep Jhuriya
Updated on 17-Jan-2023 17:12:20

42K+ Views

Introduction The Linux cat command is a powerful utility that allows users to concatenate, view and create files. One of its useful features is the ability to write text to a file, either by appending it to the end of the file or by overwriting the existing content of the file. In this article, we'll explore how to use the cat command to write text to a file in Linux, covering the various options and flags that can be used to customize the behavior of the command. Introduction to the Linux Cat Command The cat command is a simple yet ... Read More

Implement a Counter in Bash Script on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:11:01

3K+ Views

Introduction As a Linux enthusiast, you may have come across situations where you needed to perform some repetitive tasks and wished if you had a counter that could keep track of the number of times you performed a certain task. Well, guess what? Bash scripting allows you to do just that! In this article, we will discuss how you can implement a counter in your Bash scripts and use it to keep track of the number of times a certain task is performed. But before we dive into the implementation details, let's first understand what a counter is and why ... Read More

Count Duplicate Lines in a Text File on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:07:45

10K+ Views

Introduction There are several reasons why you might want to count the number of duplicate lines in a text file on a Linux system. For example, you may want to find out if there are any errors in your data or you may want to optimize your file by removing duplicates. Whatever the reason, Linux provides several tools and commands you can use to do this. Preparation Before we dive into the commands, let's first create a text file with a few duplicate lines that we can use for testing. Open a terminal and create a new file using the ... Read More

Exclude Multiple Patterns With Grep on Linux

Pradeep Jhuriya
Updated on 22-Oct-2023 12:58:24

19K+ Views

Introduction Grep is a powerful command line utility on Linux that allows users to search for patterns in text files. It is widely used for tasks such as searching log files for specific strings or patterns, searching for specific lines in a configuration file, or extracting information from a large dataset. One of the useful features of grep is the ability to exclude multiple patterns from the search. This can be useful when you want to filter out irrelevant or unwanted results from your search. In this article, we will discuss how to exclude multiple patterns with grep on Linux. ... Read More

Advertisements