Skip to content

Commit

Permalink
a simple example that mounts to a local directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tcnichol committed Nov 24, 2021
1 parent 1dee7bc commit 9f440c4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions simple-mount-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.8-slim

COPY . /home

RUN mkdir /home/data

CMD ["python3", "/home/main.py"]
7 changes: 7 additions & 0 deletions simple-mount-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.5"

services:
test:
image: tcnichol/test
volumes:
- /Users/yourUsername/test/data:/home/data
11 changes: 11 additions & 0 deletions simple-mount-example/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import time

def main():
test = 'this is only a test'
with open('/home/data/test.txt', 'w') as f:
f.write(test+'\n')
time.sleep(100)


if __name__ == '__main__':
main()

0 comments on commit 9f440c4

Please sign in to comment.