Make sure you share your drive in Docker settings.
Last active
April 20, 2020 09:20
-
-
Save iki/26b2a86cb026cae956e2a2482ee27158 to your computer and use it in GitHub Desktop.
Test volume mount in docker
This file contains 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
version: "2" | |
services: | |
test: | |
# build: . | |
image: alpine | |
command: ls -l /data | |
volumes: | |
- .:/data |
This file contains 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
FROM alpine | |
WORKDIR /data | |
COPY . . | |
CMD ls -l /data |
This file contains 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
docker-compose -p test up |
This file contains 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
docker run --rm -v %cd:\=/%:/data alpine ls -l /data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment