Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Docker Quick Start Guide

You're reading from   Docker Quick Start Guide Learn Docker like a boss, and finally own your applications

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher Packt
ISBN-13 9781789347326
Length 230 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Earl Waud Earl Waud
Author Profile Icon Earl Waud
Earl Waud
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Setting up a Docker Development Environment FREE CHAPTER 2. Learning Docker Commands 3. Creating Docker Images 4. Docker Volumes 5. Docker Swarm 6. Docker Networking 7. Docker Stacks 8. Docker and Jenkins 9. Other Books You May Enjoy

Sharing data between containers with data volume containers

There is another feature of Docker volumes that allows you to share the volume(s) mounted in one Docker container with other containers. It is called data volume containers. Using data volume containers is basically a two-step process. In the first step, you run a container that either creates or mounts Docker volumes (or both), and in the second step, you use the special volume parameter, --volumes-from, when running other containers to configure them to mount all of the volumes mounted in the first container. Here is an example:

# Step 1
docker container run \
--rm -d \
-v data-vol-01:/data/vol1 -v data-vol-02:/data/vol2 \
--name data-container \
vol-demo2:1.0 tail -f /dev/null
# Step 2
docker container run \
--rm -d \
--volumes-from data-container \
--name app-container \
vol-demo2:1.0 tail -f /dev/null...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime