docker run --name temp --rm nginx echo hi

Category: Docker

docker run --name temp --rm nginx echo hi

Run a one-off command in a disposable container

Launches nginx, overrides its command with echo hi, prints the output, and removes the container thanks to --rm. The pattern tests images without leaving clutter. --name keeps the ID memorable.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.