Share data between two different containers - Docker

0 votes
How do I share data between two different docker containers?
Nov 25, 2019 in Docker by Hannah
• 18,520 points
2,583 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, 2019 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
4,887 views
0 votes
1 answer

How to share data among docker hosts?

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

answered Jul 5, 2019 in Docker by Sirajul
• 59,190 points
1,377 views
0 votes
1 answer
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
3,225 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
7,657 views
0 votes
1 answer

How can I share data between two running Docker containers?

Share data between two running containers by various means depending on the use case. ...READ MORE

answered Nov 5, 2024 in Docker by Gagana
• 10,070 points
1,476 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP