cmdxray / one-liners / docker-run-it

docker run -it ubuntu bash

Start a throwaway container and drop into an interactive shell.

▸ Open this command in the explainer →

What it means

-i keeps stdin open and -t allocates a pseudo-terminal, together giving you an interactive session; ubuntu is the image and bash is the command to run inside it. Add --rm to delete the container automatically when you exit.

Breakdown, token by token

$ docker run -it ubuntu bash

  • dockerbuild, run and manage containers
  • runcreate and start a new container
  • -ikeep STDIN open (interactive)
  • -tallocate a pseudo-terminal
  • ubuntuan argument passed to the command
  • bashan argument passed to the command

See the full reference for docker — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.