Share data between two different containers - Docker

0 votes
How do I share data between two different docker containers?
Nov 25 in Docker by Hannah
• 17,060 points
21 views

1 answer to this question.

0 votes

Hi @Hannah, follow these steps:

1. Create an independent volume using the following command:

docker volume create --name DataVolume1

2. Create a new container and attach this newly created volume to it

docker run -ti --rm -v DataVolume1:/datavolume1 ubuntu

3. Create another container and attach this volume to it:

docker run --rm -ti -v DataVolume1:/datavolume1 ubuntu

Now you these containers have the same volume and communicate through it.

answered Nov 25 by Aria

Related Questions In Docker

+1 vote
2 answers

How to run docker containers on different machines

You can use labels and selectors for ...READ MORE

answered Oct 23, 2018 in Docker by Laila
111 views
0 votes
1 answer

How to share data among docker hosts?

Ways to achieve this when developing your ...READ MORE

answered Jul 5 in Docker by Sirajul
• 40,980 points
79 views
0 votes
1 answer

Docker containers as Jenkins Slave build agents

When you encapsulate the stage inside a ...READ MORE

answered Jun 16, 2018 in Docker by Atul
• 10,240 points
806 views
0 votes
1 answer

Different file owner inside Docker container and in host machine Ask

Filesystems, at least in Unix- and Linux-like ...READ MORE

answered Jun 25, 2018 in Docker by Damon Salvatore
• 5,510 points
89 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,960 points
251 views
0 votes
1 answer

Different file owner inside Docker container and in host machine

Here is what you can try. Since ...READ MORE

answered Jun 27, 2018 in Docker by Atul
• 10,240 points
298 views