Skip to content

Instantly share code, notes, and snippets.

@virtuald
Created July 23, 2014 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtuald/978e18936e8603a2862f to your computer and use it in GitHub Desktop.
Save virtuald/978e18936e8603a2862f to your computer and use it in GitHub Desktop.
Docker bug with ENTRYPOINT and CMD
FROM dockerfile/python
ADD / /build
ENTRYPOINT ["/build/foo.py"]
# output: args ['/build/foo.py', 'bash']
# None of these work as expected either
#CMD ['arg1']
# output: args ['/build/foo.py', '/bin/sh', '-c', "['arg1']"]
#CMD ['arg1', 'arg2']
# output: args ['/build/foo.py', '/bin/sh', '-c', "['arg1', 'arg2']"]
#CMD 'arg1 arg2'
# output: args ['/build/foo.py', '/bin/sh', '-c', "'arg1 arg2'"]
#!/usr/bin/env python
import sys
print 'args', sys.argv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment