Created
August 20, 2019 12:56
-
-
Save zeqk/5cca55a67c3e6baa399156ff8fdd6f08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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