按照书中所写,输入以下命令:
$ sudo docker run -d -p 80 --name static_web yorkz0909/static_web \ nginx -g "daemon off;"
来启动新的容器,容器貌似启动了,但是会报以下错误:
35b5d1f047a51373ca71190b0eed504ba0540c32427f4637b967c7b4ad7fa217
docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting
container process caused \"exec: \\\" nginx\\\": executable file not found in $PATH\"\n".
搜索了一下原因,可能是因为在启动的时候命令不对,于是在命令中加入/bin/sh,重新起了个名字static_web2,否则会报错命名冲突:
报错内容:
docker: Error response from daemon: Conflict. The name "/static_web1" is already in use by container
35b5d1f047a51373ca71190b0eed504ba0540c32427f4637b967c7b4ad7fa217. You have to remov