Skip to content

Commit

Permalink
docker shows output with print
Browse files Browse the repository at this point in the history
  • Loading branch information
tcnichol committed Jun 16, 2021
1 parent 28b4b37 commit df7767f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-capture-output/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.8

ENV PYTHONUNBUFFERED=0

COPY requirements.txt ./

COPY . /
RUN pip install -r requirements.txt


CMD ["python", "-u" , "main.py"]
13 changes: 13 additions & 0 deletions docker-capture-output/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import time
import sys
import logging

def main():
for i in range(0,100):
print(i)
time.sleep(5)
print('done')


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions docker-capture-output/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyclowder==2.4.0

0 comments on commit df7767f

Please sign in to comment.