Forrest logo
back to the docker tool

docker:tldr:7e3ca

docker: Run command in a new container from a tagged image.
$ docker run ${image:tag} ${command}
try on your machine

The command "docker run" is used to create and run a new container from a Docker image. It takes an image, specified by the "image:tag" argument, and runs a specified command inside that container.

Here's a breakdown of the command:

  • ${image:tag}: This is a placeholder that should be replaced with an actual Docker image name and optional tag. The image represents the base image from which the container will be created. For example, "ubuntu:latest" refers to the "ubuntu" image with the "latest" tag.

  • ${command}: Similar to the image, this is another placeholder that should be replaced with the desired command to be executed within the container. The command can be a shell command, an application, or any other executable.

When you run the complete command, Docker will pull the specified image (if not already present on your system), create a new container based on that image, and then run the specified command inside the container.

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