named volumes multiple containers code example
Example 1: share volume between containers docker-compose
services:
nginx:
build: ./nginx/
ports:
- 80:80
links:
- php
volumes:
- app-volume:location_in_the_container
php:
build: ./php/
expose:
- 9000
volumes:
- app-volume:location_in_the_container
volumes:
app-volume:
Example 2: docker create volume
$ docker volume create hello
hello
$ docker run -d -v hello:/world busybox ls /world