Docker Create, Start and Run Exec区别

Create?adds a writeable container on top of your image and sets it up for running whatever command you specified in your?CMD. The container ID is reported back but it’s not started.

Start?will start any stopped containers. This includes freshly created containers.

Run?is a combination of create and start. It creates the container and starts it.

docker exec — will execute a command in a container is already running.



用-d 参数可以在后台运行。