tanklat.blogg.se

Docker for mac network host mode
Docker for mac network host mode












docker run -it nginx:latest a Docker container exits, the filesystem inside the default container is still preserved to facilitate debugging and preserve user data. Use the image nginx:latest to start a container in interactive mode and execute the /bin/bash command inside the container. docker run -p 80:80 -v /data:/data -d nginx:latestīind the container's port 8080 and map it to port 80 on the localhost 127.0.0.1. Use the mirror nginx:latest to start a container in background mode, map port 80 of the container to port 80 of the host, and map the directory /data of the host to /data of the container. Start a container in background mode using the mirror nginx:latest and map the container's port 80 to a random port on the host. Start a container in background mode using the docker image nginx:latest and name the container mynginx. expose=: open a port or a group of ports

docker for mac network host mode

net="bridge": Specifies the container's network connection type, supports bridge/host/none/container: four types m : Set the maximum memory used by the container cpuset="0-2" or -cpuset="0,1,2": Bind the container to the specified CPU to run env-file=: Read environment variables from the specified file e username="ritchie": set environment variables h "mars": specifies the hostname of the container dns-search : Specify the container DNS search domain name, the default is the same as the host dns 8.8.8.8: Specify the DNS server used by the container, the default is the same as the host name="nginx-lb": Specify a name for the container t: reassign a pseudo input terminal for the container, usually used at the same time as -i p: Specify port mapping, the format is: 主机(宿主)端口:容器端口 P: random port mapping, the internal port of the container is randomly mapped to the port of the host i: run the container in interactive mode, usually used with -t

docker for mac network host mode docker for mac network host mode

d: run the container in the background and return the container ID a stdin: Specify the content type of standard input and output, and three items of STDIN/STDOUT/STDERR are optional Docker run : create a new container and run a command grammar docker run IMAGE














Docker for mac network host mode