Spring 5.0 By Example
上QQ阅读APP看书,第一时间看更新

Docker run

docker run is the most common Docker command. This command should be used to start the containers. The basic structure of a command is as follows:

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

The options arguments enable some configurations for the container, for instance, the      --name argument permits you to configure a name for a container. It is important for DNS when the container is running in a bridge network.

The network settings can be configured on the run command as well, and the parameter is  -- net. This enables us to configure the network to which the container will be attached. 

Another important option is detached. It indicates whether the container will run in the background. The -d parameter instructs Docker to run a container in the background.