docker-compose


docker share OS volume between services


This is an extract from Volume configuration reference, in docker docs.
version: "3"
services:
db:
image: db
volumes:
- data-volume:/var/lib/db
backup:
image: backup-service
volumes:
- data-volume:/var/lib/backup/data
volumes:
data-volume:
Can I have something similar mapped to a custom directory, instead of /var/lib/docker/volumes/?
Something like this:
version: "3"
services:
db:
image: db
volumes:
- data-volume:/var/lib/db
backup:
image: backup-service
volumes:
- data-volume:/var/lib/backup/data
volumes:
data-volume: /home/user/db
It is possible. See https://github.com/docker/docker/issues/19990#issuecomment-248955005
You will have to create the volume with docker cli.

Related Links

Can .env file make environment variables?
docker copy container data to volume using compose
Docker-compose ps error
hyperledger-fabric getting-started failed to start cli container
how to make docker-compose pull latest images of certain services
network issue in one docker compose with keycloak and tomcat container
Docker compose, set local volume mapping with version 3
version control of docker-compose.yml
Limit resources in docker-compose v3
Docker compose: using relative service address in environment
Azure Container Service: Update Docker-Compose?
Docker compose: doesnt allow to use constraints if you have a env variable set
How to use visual studio docker function on Windows Home edition?
Passing arguments to docker compose file when using it for swarm
How to run ad hoc docker compose commands in Ansible?
Using custom hostnames for docker local development containers

Categories

HOME
internet-explorer
oop
ftp
primefaces
popover
nltk
msbi
kohana
symfony-3.2
gnuradio
collision-detection
hibernate-mapping
kairosdb
dynamics-crm-2011
aspectj
virtualenv
popup
nsoperation
amazon-data-pipeline
android-wifi
tcpdf
ng-tags-input
chartist.js
windows-mobile
multiple-inheritance
resx
apm
opencsv
tikz
urhosharp
directions
pymunk
device-driver
scip
mediastream
observer-pattern
risc
npoco
togglebutton
react.rb
ear
wink
aws-rds
cc
ios-keyboard-extension
instaparse
android-progressbar
dcast
database-project
notice
exchange-server-2007
android-filterable
web-standards
system.diagnostics
genome
httpmodule
sicstus-prolog
chrome-mobile
nexusdb
report-builder2.0
grunt-contrib-connect
livescript
angular-file-upload
lettuce
db2-connect
lastinsertid
pechkin
extensibility
android-library
msbuild-task
gpl
idoc
m3u
teamsystem
waveout
pinchzoom
vectorwise
execjs
viewdata
dynamic-scope
file-storage

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App