https://github.com/codeimpossible/docker-volume-example
https://github.com/codeimpossible/docker-volume-example
docker docker-patterns docker-volumes patterns
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codeimpossible/docker-volume-example
- Owner: codeimpossible
- License: mit
- Created: 2018-08-28T17:46:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T17:58:26.000Z (about 7 years ago)
- Last Synced: 2025-01-10T09:36:06.261Z (9 months ago)
- Topics: docker, docker-patterns, docker-volumes, patterns
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker volume example
this is a test repo to show an issue I ran into with volume sharing in the docker-orchestrating-docker pattern.
## Running the example
```
$ ./start.sh
```Will tell docker to build and run `Prep.dockerfile`. This container creates a volume to store some the files within the repo:
- `vol_scripts` which contains all the *.sh files
## The issue
The prep container will build successfully, but the `docker run` command will fail with an error similar to ```cp: can't stat '/app/*.sh': No such file or directory```This happens whenever a container attempts to access a volume that is in use inside another container. In this case it's the `/app` volume on the prep container that is causing the error, since `prep.sh` attempts to bind-mount that directory into a container in order to populate the other docker volumes with data.
## The workaround
So far the workaround has been to take any data that you need to share between containers that are run via the DOD pattern and store it in volumes _before_ you launch the container and mount them in using the `-v` or `--mount` options of `docker run`.