docker run -it --rm --entrypoint sh nginx

Category: Docker

docker run -it --rm --entrypoint sh nginx

Run an image with an overridden entrypoint

Starts nginx with sh as the entrypoint, giving an interactive shell instead of the web server. --rm removes the container on exit. Useful for debugging images whose default entrypoint fails.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.