赋予 privileged 权限.
Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
parent
22e6210497
commit
4650524628
|
@ -91,8 +91,8 @@ docker pull ubuntu:18.04
|
||||||
docker run <image name/id>
|
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 <host ip:port><container port> -v <host dir>:<container dir> <image name/id> /bin/bash
|
||||||
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,指定容器名称,并将宿主机的某目录挂载到容器的对应目录下
|
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,指定容器名称,赋予 privileged 权限,并将宿主机的某目录挂载到容器的对应目录下
|
||||||
docker run -it -P --name=<a container name> -v <host dir>:<container dir> <image name/id> /bin/bash
|
docker run -it -P --name=<a container name> --privileged -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
|
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