我正在学习码头,并试图运行现有的图像。第一个命令工作正常。
command 1: docker run --name static-site -e AUTHOR="Mathi1" -d -P dockersamples/static-site
但是下面的命令是抛出错误
Command 2: docker run --name mvcdotnet -e AUTHOR="Mathi2" -d -p valkyrion/mvcdotnet
错误:
“码头运行”至少需要一个参数。 参见“docker run --help”。 用法: docker run OPTIONS映像命令 在新容器中运行命令
发布于 2019-03-07 10:29:44
根据docker help run
…
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
…命令1使用-P (--publish-all的简称),然后使用图像名。-P没有任何论点。命令2使用-p (--publish list的简称)。-p需要一个参数,我认为docker将图像名错误为-p的参数(并期望在此之后有一个图像名称)。
https://stackoverflow.com/questions/55041231
复制相似问题