I'm trying to understand a discrepancy between ENTRYPOINT
in Dockerfile and docker run --entrypoint
. The exec
form of ENTRYPOINT
allows multiple parameters,
# Source: https://docs.docker.com/engine/reference/builder/#entrypoint
ENTRYPOINT ["executable", "param1", "param2"]
but docker run --entrypoint=executable
accepts only one. Many examples show how to override ENTRYPOINT
with arguments, but they do so by also specifying CMD
:
docker run --entrypoint=executable image:latest param1 param2
Is there a technical limitation preventing a direct docker run --entrypoint
equivalent to ENTRYPOINT ["executable", "param1", "param2"]
? Docker Compose seems to support it with
# Source: https://docs.docker.com/compose/compose-file/compose-file-v3/#entrypoint
entrypoint: ["php", "-d", "memory_limit=-1", "vendor/bin/phpunit"]
as do other providers which work with Docker (e.g. AWS ECS). Or perhaps, internally, [...entrypoint_args, ...command_args]
is actually massaged into [entrypoint, ...command]
to make it compatible with docker run
?