What are the basic commands of Docker
Editor to share with you what the basic Docker commands are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
List the available commands, or run docker with no parameters or execute docker help
Sudo dockeruseage of docker-D default false allows debug mode (debug mode)-H defaults to unix:///var/run/docker.sock tcp:// [host [: port]] to bind or unix:// [/ path/to/socket] to use (binary files), when host ip host= [0.0.0.0], (port) port= [4243] or path= [/ var/run/docker.sock] are default values Use as the default-api-enable-cors default flase allows CORS header remote api- b to be empty by default and attached to an existing bridge. If you use the 'none' parameter, the container's network is disabled-bip is empty by default Dynamically create a bridge (dcoker0) using the supplied CIDR (Classless Inter-Domain Routing- untyped inter-domain routing) tag address, and conflict with the-b parameter-d default false allows process mode (daemon mode)-dns is empty by default, so that docker uses the specified DNS server-g defaults to "/ var/lib/docker": root path used by docker-icc default true Allow inter-container to communicate-ip default "0.0.0.0": bind container port default Ip address-iptables default true disable docker add iptables rule-mtu default 1500: set the maximum unit of container network transmission (mtu)-p default is the file path used by / var/run/docker.pid process pid-r default is run before true restart Container-s is empty by default This is the docker run using a specified storage drive-v default false print version information and exit
When your process uses the-d flag, docker uses a persistent process to manage the container, and docker uses the same process and client.
Docker uses-d-s to map stored programs, forcing docker to use mapped memory to store drivers.
Docker uses-d-dns 8.8.8.8 to set up DNS servers for all docker containers.
Docker uses the-d-D parameter to make the process output debug information
For docker clients, you can also use the environment variable parameters of DOCKER_HOST to change the parameter settings of docker-H
Docker-H tcp://0.0.0.0:4243 ps# orexport DOCKER_HOST= "tcp://0.0.0.0:4243" docker ps# both are equalattachusage: docker attach CONTAINER attach to run a container-nostdin default parameter false do not attach stdin (input)-sig-proxy default true Proxify all received signal flow (even in non-tty mode)
You can separate the docker from the container and run it, and then use CTRl-c to exit or CTRL -\ to get a docker exit of the exception stack. When the container exit process returns the exit code to the client
Use docker stop to stop a container
Use docker kill to kill a container
Attach examples ID=$ (sudo docker run-d ubuntu / usr/bin/top-b) sudo docker attach $ID is all the content of this article "what are the basic Docker commands?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!