Forrest logo
back to the docker tool

docker:tldr:553a5

docker: Run command in a new container with passed environment variables.
$ docker run --env '${variable}=${value}' --env ${variable} ${image} ${command}
try on your machine

The command "docker run" is used to run a Docker container. Here's an explanation of the different parts of the command:

--env '${variable}=${value}': This option is used to set environment variables inside the running container. In this case, the variable is supplied using single quotes ('') to prevent variable expansion by the shell, and it is set to the provided value.

--env ${variable}: This option is used to set environment variables without specifying a value. The value for this variable will be taken from the current environment where the docker run command is executed.

${image}: This is the name or ID of the Docker image that you want to run.

${command}: This is an optional command that specifies what should be executed inside the container once it is running.

In summary, the command starts a new Docker container from the specified image. It sets environment variables inside the container using both provided values and values from the current environment. Finally, it can optionally execute a 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