Make sure you share your drive in Docker settings.
-
-
Save sagar290/4785ef170486d44d7129bfb2c3b42f3b 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