The docker run command has a -P, --publish-all option which publishes all the exposed ports of the image to random ports on the host. But since the .NET Dockerfiles don't have an EXPOSE instruction, Docker doesn't know what ports to publish and so publishes none....
docker run 只在第一次运行时使用,将镜像放到容器中,以后再次启动这个容器时,只需要使用命令docker ...
-m, --memory="",指定容器的内存上限 -P, --publish-all=false,指定容器暴露的端口 -p, --publish=[],指定容器暴露的端口 -h, --hostname="",指定容器的主机名 -v, --volume=[],给容器挂载存储卷,挂载到容器的某个目录 --volumes-from=[],给容器挂载其他容器上的卷,挂载到容器的某个目录 --cap...
-P,--publish-all=true|false默认为false(为容器暴漏的所有端口进行映射) docker run -P -i -t ubuntu /bin/bash -p,--publish=[] containerPort docker run -p 80 -i -t ubuntu /bin/bash hostPort:containerPort docker run -p 8080:80 -i -t ubuntu /bin/bash ip::containerPort docker run ...
-P,--publish-all Publish all exposed ports to random ports --rm Automatically remove the container when it exits -t,--tty Allocate a pseudo-TTY -v,--volume list Bind mount a volume default[] --volume-driver string Optional volume driver for the container ...
-P, --publish-all Publish all exposed ports to random ports --pull missing Pull image before running (always, missing, never) -q, --quiet Suppress the pull output --read-only Mount the container's root filesystem as read only --restart no Restart policy to apply when a container exits...
25. -P, --publish-all:将所有暴露的端口发布到主机随机端口 26. --pull:运行前拉取图像,(always|missing|never),默认 missing 27. --pids-limit:限制容器中pid个数 28. --read-only :将容器跟文件系统装载为只读 29. --restart:当容器退出时的重启策略,默认为no ...
-P, --publish-all Publish all exposed ports to random ports --pull missing Pull image before running (always, missing, never) -q, --quiet Suppress the pull output --read-only Mount the container's root filesystem as read only --restart no Restart policy to apply when a container exits...
[-P|--publish-all] [-p|--publish[=[]]] [--pid[=[PID]]] [--userns[=[]]] [--pids-limit[=PIDS_LIMIT]] [--privileged] [--read-only] [--restart[=RESTART]] [--rm] [--security-opt[=[]]] [--storage-opt[=[]]] [--stop-signal[=SIGNAL]] [--stop-timeout[=TIMEOUT]]...
将网络设置为container一个容器将共享另一个容器的网络堆栈。另一个容器的名称必须以格式提供--network container:<name|id>。请注意,--add-host--hostname--dns--dns-search--dns-option并且--mac-address在containernetmode 中无效,并且在netmode--publish--publish-all--expose中也无效container。