Home>Article>Operation and Maintenance> What command to use to run docker container
The command to run a container in docker is "docker run option image name"; the function of the run command is to create and run a container. A container can only be created if there is an image. The parameter image name can also be replaced by the image ID. When When the "-d" parameter is added to the run command, the container will be run in the background and the container ID will be returned.
The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.
What command is used to run a docker container
docker run: Create a new container and run a command
The syntax is as follows :
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Among them, the image name can also be replaced by the image ID,
The most commonly used option
-i: In interactive mode Run the container, usually used together with -t,
-t: Reassign a pseudo input terminal, that is, tty, to the container, usually used together with -i,
--name: Specify a new running name for the container,
-d: Run the container in the background and return the container ID, that is, start the daemon Containers, docker containers running in the background, must have a foreground process
docker video tutorial"
The above is the detailed content of What command to use to run docker container. For more information, please follow other related articles on the PHP Chinese website!