So I've got a docker image with a python script as the entry-point and I would like to pass arguments to the python script when the container is run. I've tried to get the arguments using sys.argv and sys.stdin, but neither has worked. I'm trying to run the container using:
docker run image argument
It depends how the entrypoint was set up. If it was set up in "exec form" then you simply pass the arguments after the
docker run
command, like this:If it was set up in "shell form" then you have to override the entrypoint, unfortunately.
You can check the form using
docker inspect
. If the entrypoint appears to begin with/bin/sh -c
, then it is shell form.References: