Skip to content

Commit 35a6edd

Browse files
authored
Merge pull request #62 from YaleDHLab/docker-volume-mounts
document how to mount data volumes into container
2 parents 4196dc0 + 33aa72c commit 35a6edd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ Once Docker is installed, start a terminal, cd into the folder that contains thi
5555
# build the container
5656
docker build --tag pixplot --file Dockerfile .
5757

58-
# process images
59-
docker run -v $(pwd)/output:/pixplot/output pixplot \
58+
# process images - use the `-v` flag to mount directories from outside
59+
# the container into the container
60+
docker run \
61+
-v $(pwd)/output:/pixplot/output \
62+
-v /Users/my_user/Desktop/my_images:/pixplot/images \
63+
pixplot \
6064
bash -c "cd pixplot && python3.6 utils/process_images.py images/*.jpg"
6165

6266
# run the web server
63-
docker run -v $(pwd)/output:/pixplot/output \
64-
-p 5000:5000 pixplot bash -c "cd pixplot && python3.6 -m http.server 5000"
67+
docker run \
68+
-v $(pwd)/output:/pixplot/output \
69+
-p 5000:5000 \
70+
pixplot \
71+
bash -c "cd pixplot && python3.6 -m http.server 5000"
6572
```
6673

6774
Once the web server starts, you should be able to see your results on `localhost:5000`.

0 commit comments

Comments
 (0)