Guest User

Untitled

a guest
Jun 24th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ENTRYPOINT ["python", "/cont_dirpath/script.py"]
  2.  
  3. docker run -v /host_dirpath:/cont_dirpath 84730be6107f
  4.  
  5. from docker import Client
  6.  
  7. docker = Client(base_url='unix://var/run/docker.sock',
  8. version='1.10',
  9. timeout=10)
  10.  
  11. contid = docker.create_container('84730be6107f', volumes={"/cont_dirpath":""})
  12. docker.start(contid, binds={"/host_dirpath": {"bind": "/cont_dirpath"} })
  13.  
  14. print "Docker logs: n" + str(docker.logs(contid))
  15.  
  16. kubectl logs $CONTAINERID
  17.  
  18. import time
  19. while True:
  20. print('something')
  21. time.sleep(1)
  22.  
  23. import time
  24. import sys
  25. while True:
  26. print('something')
  27. sys.stdout.flush()
  28. time.sleep(1)
Add Comment
Please, Sign In to add comment