Raunak Jain has Published 52 Answers

How to deal with persistent storage (e.g. databases) in Docker?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:55:46

You can use Docker volumes to achieve a solution for persistent storage in Docker. There are bind mounts as well but the problem with them is that they are highly dependent on the underlying host as well as the directory structure. The volumes are completely managed and controlled by Docker. ... Read More

How to copy files from host to Docker container?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:53:21

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 ... Read More

How to copy Docker images from one host to another without using a repository?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:47:34

If you have a Docker image in your own local machine and you want that image to be copied into another machine, there are two ways to do that. The first is by pushing that image to a repository such as the ones in Dockerhub registry. You need to have ... Read More

How is Docker different from a Virtual Machine?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:44:52

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 ... Read More

How does one remove a Docker image?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:39:49

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 ... Read More

How do I run a command on an already existing Docker container?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:36:00

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 ... Read More

How do I pass environment variables to Docker containers?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:34:16

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 ... Read More

How do I get into a Docker container's shell?

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:32:03

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 ... Read More

From inside of a Docker container, how do I connect to the localhost of the machine

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:28:12

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 ... Read More

Copying files from Docker container to Host

Raunak Jain

Raunak Jain

Updated on 06-Aug-2021 11:26:49

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, ... Read More

Advertisements