New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow --entrypoint
to be set to null
in a docker run
or docker create
#23498
Comments
Try this |
I'm aware that this and other workarounds exist, but that doesn't mean that
|
@programmerq I created a pull request #23718 to address this issue. If Please let me know if there are any issues. |
This fix tries to address the issue raised in moby#23498 to allow unset `--entrypoint` in `docker run` or `docker create`. This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`) is passed, unset the Entrypoint during the container run. Additional integration tests have been created to cover changes in this fix. This fix fixes moby#23498. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This fix tries to address the issue raised in moby#23498 to allow unset `--entrypoint` in `docker run` or `docker create`. This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`) is passed, unset the Entrypoint during the container run. Additional integration tests have been created to cover changes in this fix. This fix fixes moby#23498. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
As regards the entrypoint... should we just ensure that it's unset, and then do everything through the
The main drawback is that there's no choice over which shell is used Will keep looking for other ways |
most images only have a CMD set, no separate ENTRYPOINT, so you won't have to override it, but you can docker inspect --format '{{json .Config}}' docker.io/library/python:3.9.2-slim | jq .
{
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=E3FF2839C048B25C084DEBE9B26995E310250568",
"PYTHON_VERSION=3.9.2",
"PYTHON_PIP_VERSION=21.0.1",
"PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/b60e2320d9e8d02348525bd74e871e466afdf77c/get-pip.py",
"PYTHON_GET_PIP_SHA256=c3b81e5d06371e135fb3156dc7d8fd6270735088428c4a9a5ec1f342e2024565"
],
"Cmd": [
"python3"
],
"Image": "sha256:09147162b3f325a1bdc0df946f3ac8ed04e7690c7d17a754f88fc640cd1a23d4",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
} |
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:
entrypoint:
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:
Providing some way for
docker run
ordocker create
to force the ENTRYPOINT to be null without having to create another image would be great.The text was updated successfully, but these errors were encountered: