Forrest logo
back to the docker tool

docker:tldr:1bc89

docker: Run command in a new container in background and display its ID.
$ docker run --detach ${image} ${command}
try on your machine

The docker run command is used to create and run a new container based on a specified image. The --detach option is used to detach the container from the current terminal session, allowing it to run in the background.

${image} is a placeholder for the name of the Docker image that you want to use for the container. You should replace ${image} with the actual name of the image you want to use.

${command} is a placeholder for the command that you want the container to execute when it starts. You should replace ${command} with the actual command you want to run inside the container.

Here's an example usage:

docker run --detach ubuntu:latest sleep 3600

This command creates a new container based on the ubuntu:latest image and runs the sleep command with an argument of 3600 inside the container. The --detach option allows the container to run in the background without blocking the terminal.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool