I would like to be able to "unset" an ENTRYPOINT at the command line when creating a container.
Using this Dockerfile and entrypoint.sh as an example:
Dockerfile:
FROM alpine
ADD entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD echo foobar
entrypoint:
#!/bin/sh
echo "I am an entrypoint"
exec "$@"
If I wanted to unset the entrypoint, I would like to be able to run this: docker run --entrypoint='' --rm -it image echo foo
I would expect this to produce the following output:
but it does the following instead:
I am an entrypoint
foo
Providing some way for docker run
or docker create
to force the ENTRYPOINT to be null without having to create another image would be great.
Try this
docker run --entrypoint=/bin/echo --rm image foo
I'm aware that this and other workarounds exist, but that doesn't mean that
this issue couldn't or shouldn't be addressed.
On Jun 13, 2016 5:11 PM, "Shijiang Wei" [email protected] wrote:
Try this
docker run --entrypoint=/bin/echo --rm image foo—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/docker/docker/issues/23498#issuecomment-225735177,
or mute the thread
https://github.com/notifications/unsubscribe/AACRnuHYnJydqWbZbVezdavvgV-VZHXkks5qLeOIgaJpZM4I0tri
.
@programmerq I created a pull request #23718 to address this issue. If --entrypoint=
(with empty string ""
) is passed then docker run
or docker create
will unset the entrypoint and rely on the default behavior.
Please let me know if there are any issues.
Most helpful comment
@programmerq I created a pull request #23718 to address this issue. If
--entrypoint=
(with empty string""
) is passed thendocker run
ordocker create
will unset the entrypoint and rely on the default behavior.Please let me know if there are any issues.