Skip to content

Instantly share code, notes, and snippets.

@webgtx
Created May 26, 2022 18:50
Show Gist options
  • Save webgtx/dbe48641078cd06c32f922d8281d0111 to your computer and use it in GitHub Desktop.
Save webgtx/dbe48641078cd06c32f922d8281d0111 to your computer and use it in GitHub Desktop.
docker volume control
# create the volume in advance
docker volume create --driver local \
--opt type=none \
--opt device=/home/user/test \
--opt o=bind \
test_vol
# create on the fly with --mount
docker run -it --rm \
--mount type=volume,dst=/container/path,volume-driver=local,volume-opt=type=none,volume-opt=o=bind,volume-opt=device=/home/user/test \
foo
# inside a docker-compose file
...
test:
...
volumes:
- bind-test:/var/lib/grafana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment