Skip to content

Instantly share code, notes, and snippets.

@zeqk
Created August 20, 2019 12:56
Show Gist options
  • Select an option

  • Save zeqk/5cca55a67c3e6baa399156ff8fdd6f08 to your computer and use it in GitHub Desktop.

Select an option

Save zeqk/5cca55a67c3e6baa399156ff8fdd6f08 to your computer and use it in GitHub Desktop.
# create the volume in advance
```bash
docker volume create --driver local \
--opt type=none \
--opt device=/home/user/test \
--opt o=bind \
test_vol
````
# create on the fly with --mount
```bash
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
```yml
volumes:
bind-test:
driver: local
driver_opts:
type: none
o: bind
device: /home/user/test
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment