- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2065 Articles for Operating System
204 Views
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. In this article, let’s discuss the basic differences between Docker containers and virtual machines.However, before we start the discussion make sure that you have the basic knowledge of what Docker is. You ... Read More
2K+ Views
If you have been using Docker for quite a long time now, you might have several unused images already existing in your local machine. These images might be previously downloaded older versions, or simply an image that you downloaded for testing. These images take up a lot of space unnecessarily and reduce the overall performance and experience. Moreover, they are several unused, dangling images as well.It’s always better to remove these older images which will help you to keep track of all your useful images in a better way. Docker allows you to remove images quite easily and through many ... Read More
3K+ Views
Suppose you have already created a Docker container previously and have worked with it. Now, you have stopped the container. So, the container is in exited state. What if you want to run a command inside the container?Typically, there can be two cases. Either the container is stopped using the Docker stop command or the container is currently running in the background. In such a case, either you can start the container back, access it’s bash, and execute whatever command that you want. This is perfect for containers that are not running. Another solution is that you use the Docker ... Read More
1K+ Views
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 flagTo demonstrate this example, let’s use the ... Read More
15K+ Views
Once you have your Docker container up and running, you can work with the environment of the Docker container in the same way you would do with an Ubuntu machine. You can access the bash or shell of the container and execute commands inside it and play around with the file system. You can build, test, and deploy your applications inside the container itself.Predominantly, there are 3 ways to access the shell of a running container. These are -Using the Docker run command to run a container and access its shell.Using the Docker exec command to run commands in an ... Read More
13K+ Views
Suppose you have an Nginx web server running inside an Nginx container in your host machine. And you have a MySQL database running in your host machine. Now, you want to access the MySQL server in your host machine from the Nginx container. Also, the MySQL is running on your localhost and the host machine does not expose any port to the outside world. Hence, we can conclude that MySQL is bound to be run on localhost only and not accessible to the outside world because it is not bound on the IP address.In this article, we will explain the ... Read More
2K+ Views
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 you have ... Read More
844 Views
In normal cases we make use of the bash_profile or bashrc in case of Ubuntu and zshrc in case of Mac OS, to set our environment variables and then those variables are made available to us everywhere on the terminal we want.Let’s consider a simple example where we have some environment variable in bash_profile and we are making use of it in the terminal.Consider the bash_profile output shown below −immukul@192 dir1 % cat ~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$PATH:/usr/local/node/bin export GOROOT=/usr/local/go export GOPATH=/Users/immukul/go_projectsAs we can see there are many variables present in the bash_profile file, we can use these variables in ... Read More
237 Views
Linux provides us with different utility commands that we can make use of to print a random line from any files in the Unix command line. Mostly we make use of either the shuf command or the sort command, and in this article I’ll explain both the commands and which one is better and why.Shuf CommandThe shuf command in Linux is used to write random permutations of the input lines to the standard output. The idea of randomizing the input is the same as one does when the cards are shuffled. On most of the Linux operating systems it is ... Read More
235 Views
Linux provides the famous top command utility that provides us with all the information about the processes, their time, their respective IDs, how much CPU chunk they are consuming and much more. The only issue with that is the processes are not sorted in any order and the order changes frequently.There are certain cases where we would like the output to be in a sorted manner somehow, like sorted in the sense that the process which is using the most network will be at the top.One such command line program that we can use that will provide us the desired ... Read More
To Continue Learning Please Login
Login with Google