-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
docker compose run --entrypoint=EXECUTABLE SERVICENAME
fails to clear CMD
#9622
Comments
Is there a suggested workaround for this? It seems like this thread is possibly the same issue: #9483. But the suggested workaround there (using CMD in Dockerfile) doesn't provide the same functionality of being able to override with "command" at run-time, which I have been doing in a docker-compose.override.yml file to run a different command in development. This worked fine with v1, and I can't imagine why this is not a bug. |
If stuck with a Compose version that does not yet include the fix (releases prior to v2.11.2), I'd try to resolve it by looking if there's an argument that doesn't affect what the particular entrypoint command you're setting and explicitly set the command (=default arguments to the entrypoint) to that instead of expecting it to be empty. In the $ docker compose run --rm --entrypoint=ls database by $ docker compose run --rm --entrypoint=ls database . to effectively make the full command |
@totalhack @fedde-s the release of Compose |
BUG REPORT INFORMATION
Description
If I run a one-off container based on a service definition using the
run
subcommand and override the entrypoint, Compose 2.6.0 fails to clear the default command (default arguments to the default entrypoint) as well. As far as I can think of, every other Docker interface to override the entrypoint also clears CMD:docker-compose run
in v1run
subcommand of Docker itself:Steps to reproduce the issue:
$ docker compose run --rm --entrypoint=ls database
Describe the results you received:
The new entrypoint,
ls
, responds as if it was passed the default arguments intended for the original entrypoint, namely the--help
, flag, and prints a usage message.`Describe the results you expected:
I expected the new entrypoint,
ls
, to be run without arguments and list the files in the container's working directory.Additional information you deem important (e.g. issue happens only occasionally):
None.
Output of
docker compose version
:Output of
docker info
:Snippet:
Additional environment details:
—
The text was updated successfully, but these errors were encountered: