We can modify entrypoint
of a non-running container with the docker run
command.
Example show PATH environment variable:
using bash
and echo
: This answer claims that echo
will not produce any output, which is incorrect.
docker run --rm --entrypoint bash <container> -c 'echo "$PATH"'
using printenv
docker run --rm --entrypoint printenv <container> PATH