Docker background Process parameters-------change the way Docker runs the root directory

Source: Internet
Author: User
Tags docker ps docker run

Parameters Introduction
--api-enable-cors=false Remote API calls.
-B,--bridge= "" Bridging the bridge device on a system into a Docker container, using none to deactivate the network in the container
--bip= "" Use CIDR addresses to set the IP of the Network Bridge. This parameter and-B cannot be used together.
-D,--debug=false Turn on debug mode. Example: docker-d-D
-D,--daemon=false Turn on daemon mode.
--dns=[] Sets the container to use a DNS server. Example: docker-d--dns 8.8.8.8
-dns-search=[] Sets the container to use the specified DNS search domain name. such as: docker-d--dns-search example.com
--exec-driver= "native" Sets the container to use the specified run-time driver. such as: docker-d-e Lxc
-G,--group= "Docker" In background run mode, assign the specified group to the appropriate UNIX socket. Note that the group information is stripped when this parameter--group is given an empty string
-G,--graph= "/var/lib/docker" Setting up the Docker runtime root directory
-H,--host=[] Setting the socket bindings in background mode, you can bind one or more tcp://host:port, Unix:///path/to/socket, fd://*, or FD://SOCKETFD. such as: $ docker-h tcp://0.0.0.0:2375 PS or $ export docker_host= "tcp://0.0.0.0:2375" $ docker PS
-icc=true Set up communication that enables inline containers.
--ip= "0.0.0.0" Set the default IP address to use when the container binds IP
--ip-forward=true Set the Net.ipv4.ip_forward of the boot container
--iptables=true Set up iptable rules for starting Docker container customizations
--mtu=0 Set the MTU value for the container network, and if this parameter is not available, choose the default route MTU and set the constant value to 1500 if there is no default route.
-P,--pidfile= "/var/run/docker.pid" Sets the background process PID file path.
-R,--restart=true Set the container in the run before restarting
-S,--storage-driver= "" The settings container runs with the specified storage driver, as specified using Devicemapper, which can be: docker-d-S Devicemapper
--selinux-enabled=false Setting Enable SELinux support
--storage-opt=[] Setting Storage-driven parameters
Docker Configuration file Location

Docker configuration file can set most of the background process parameters, in the various operating systems in the storage location inconsistent

The location in Ubuntu is:/etc/default/docker

The position in CENTOS6 is:/etc/sysconfig/docker

The position in Centos7 is:/etc/docker/

CENTOS6 How to change the Docker run root directory

Many Linux users, when installing the system, did not allocate the/var partition, and after installing Docker, it was found that the default storage location is/var/lib/docker. As a result, Docker is running slowly, so how do you solve this problem? Let's take a look at the solution.

Workaround:

One is the re-installation system, which is too impersonal, ignoring ... The next time you deploy the Docker host, you need to partition it well.

The second is to change the Docker default storage path.

Check the manual. Found:-G,--graph= "/var/lib/docker" setting Docker runtime root directory

Using the--graph parameter: Docker--graph=/opt/docker-d, the/opt/docker directory (0700) is automatically generated and the Docker-related files are created in this directory

The original image and container are not found, because the path changed (the original image is in/var/lib/docker/devicemapper/devicemapper/{data,metadata})

Docker configuration file can set most of the background process parameters, in the various operating systems in the storage location inconsistent

The location in Ubuntu is:/etc/default/docker

The location in CentOS is:/etc/sysconfig/docker

I use CentOS 7, so just change vim/etc/sysconfig/docker to

Options=--graph= "/home/lib/docker"--selinux-enabled-h fd://

Then the service Docker start restarts the Docker path and changes to/home/lib/docker.

The above is to solve the Docker storage space is too small, causing Docker to run slowly, there are users who encounter this problem, use this method to solve it.

Centos7 changing the Docker run root configuration:

/etc/docker/daemon.json

{    "graph": "/app/docker"}

Docker background Process parameters-------change the way Docker runs the root directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.