Forked from shaiguitar/gist:627d52ebc0c03af488477b5d636a8909
Created
March 22, 2022 17:36
-
-
Save jet10000/1e0ced20bbc12622de8b36be2dca0aa2 to your computer and use it in GitHub Desktop.
Using docker compose to mount current working directory dynamically into the container
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
# mount volume PWD on host to /app in container. | |
shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml | |
version: "3" | |
services: | |
some_server: | |
... | |
volumes: | |
- $PWD:/app | |
# so using this from which/wherever you run this from, PWD should be updated and reflected within the container it runs in. | |
# /app within container should be reflected to be wherever you run this command from. | |
docker-compose -f ~/tmp/example-working-docker-compose-environment-vars/docker-compose.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment