Package: docker-run-cli
docker-run–docker runanddocker execwith useful defaultsdocker-runis a CLI tool for simplified interaction with Docker images. Use it to easily start and attach to Docker containers with useful predefined arguments.Whiledocker-runcan be used with any Docker image, we recommend to also check out our other tools for Docker and ROS.docker-rosautomatically builds minimal container images of ROS applicationsdocker-ros-ml-imagesprovides machine learning-enabled ROS Docker imagesQuick DemoThe following quickly launches the GUI applicationxeyesto demonstrate howdocker-runtakes care of X11 forwarding from container to host. The--verboseflag prints the underlyingdocker runcommand that is run under the hood.docker-run--verbose607qwq/xeyesFunctionalitydocker-runis designed to be used the same way as the officialdocker runanddocker execcommands.In general, you can pass the same arguments todocker-runas you would pass todocker run, e.g.docker-run--volume$(pwd):/volumeubuntuls/volumeIn addition to the arguments you are passing,docker-runhowever also enables the following features by default. Each of these default features can be disabled, seeUsage.container removal after exit (--rm)interactive tty (--interactive --tty)current directory name as container name (--name)GPU support (--gpus all/--runtime nvidia)X11 GUI forwardingIf a container with matching name is already running,docker-runwill execute a command in that container viadocker execinstead. This lets you quickly attach to a running container without passing any command, e.g.docker-run--namemy-running-containerUnlike withdocker run, you can also set the Docker image via the--imagearguments, seeUsage. This may be required for more complex use cases.Installationpipinstalldocker-run-cli# (optional) shell auto-completionsource$(activate-python-docker-run-shell-completion2>/dev/null)WarningOutside of a virtual environment,pipmay default to a user-site installation of executables to~/.local/bin, which may not be present in your shell'sPATH.  If runningdocker-runerrors withdocker-run: command not found, add the directory to your path.(More information)echo"export PATH=\$HOME/.local/bin:\$PATH">>~/.bashrcsource~/.bashrcUsageusage: docker-run [--help] [--image IMAGE] [--mwd] [--name NAME] [--no-gpu]
                  [--no-it] [--no-loc] [--no-name] [--no-rm] [--no-tz]
                  [--no-x11] [--verbose] [--version]

Executes `docker run` with the following features enabled by default, each of
which can be disabled individually: container removal after exit, interactive
tty, current directory name as container name, GPU support, X11 GUI
forwarding. Passes any additional arguments to `docker run`. Executes `docker
exec` instead if a container with the specified name (`--name`) is already
running.

optional arguments:
  --help         show this help message and exit
  --image IMAGE  image name (may also be specified without --image as last
                 argument before command)
  --mwd          mount current directory at same path
  --name NAME    container name; generates `docker exec` command if already
                 running
  --no-gpu       disable automatic GPU support
  --no-it        disable automatic interactive tty
  --no-loc       disable automatic locale
  --no-name      disable automatic container name (current directory)
  --no-rm        disable automatic container removal
  --no-tz        disable automatic timezone
  --no-x11       disable automatic X11 GUI forwarding
  --verbose      print generated command
  --version      show program's version number and exitPluginsdocker-runcan be extended through plugins. Plugins are installed as optional dependencies.# install specific plugin <PLUGIN_NAME>pipinstalldocker-run-cli[<PLUGIN_NAME>]# install all pluginspipinstalldocker-run-cli[plugins]PluginDescriptiondocker-rosextra functionality for Docker images built bydocker-ros