parent
dbdcf96370
commit
22e6210497
|
@ -91,8 +91,8 @@ docker pull ubuntu:18.04
|
|||
docker run <image name/id>
|
||||
# 运行某镜像,为之创建容器,将宿主机端口影射到容器端口,并将宿主机的某目录挂载到容器的对应目录下
|
||||
docker run -it -p <host ip:port><container port> -v <host dir>:<container dir> <image name/id> /bin/bash
|
||||
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,并将宿主机的某目录挂载到容器的对应目录下
|
||||
docker run -it -P -v <host dir>:<container dir> <image name/id> /bin/bash
|
||||
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,指定容器名称,并将宿主机的某目录挂载到容器的对应目录下
|
||||
docker run -it -P --name=<a container name> -v <host dir>:<container dir> <image name/id> /bin/bash
|
||||
# 运行某镜像,为之创建容器,设置网络参数,并将宿主机的某目录挂载到容器的对应目录下
|
||||
docker run --net=<bridge/host/container:container name or id/none> -it -v <host dir>:<container dir> <image name/id> /bin/bash
|
||||
# 查看正在运行的容器
|
||||
|
|
Loading…
Reference in New Issue