By default, /etc/default/docker configuration will not take effect. We need to manually add it to the docker environment settings. The file to be configured is docker.service When configuring docker.service, the EnvironmentFile file is configured by default with #Modify the configuration file vi /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.com After=network.target Wants=docker-storage-setup.service Requires=docker-cleanup.timer [Service] Type=notify NotifyAccess=all KillMode=process #Add our custom configuration file EnvironmentFile=-/etc/default/docker #Add configuration file, (- stands for ignore error) EnvironmentFile=-/etc/sysconfig/docker EnvironmentFile=-/etc/sysconfig/docker-storage EnvironmentFile=-/etc/sysconfig/docker-network Environment=GOTRACEBACK=crash Environment=DOCKER_HTTP_HOST_COMPAT=1 Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin ExecStart=/usr/bin/dockerd-current \ --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ --default-runtime=docker-runc \ --exec-opt native.cgroupdriver=systemd \ --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ $OPTIONS \ $DOCKER_STORAGE_OPTIONS \ $DOCKER_NETWORK_OPTIONS \ $ADD_REGISTRY \ $BLOCK_REGISTRY \ $INSECURE_REGISTRY \ $DOCKER_OPTS #Parameters that need to be referenced, which are also the network card setting parameters ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity TimeoutStartSec=0 Restart=on-abnormal MountFlags=slave [Install] WantedBy=multi-user.target EnvironmentFile=-/etc/default/docker After the modification, you need to reload and then restart the service to use the DOCKER_OPTS parameters defined in /etc/default/docker #Reload systemctl daemon-reload #Restart the docker service service docker restart Docker environment configuration file vi /etc/sysconfig/docker DOCKER_OPTS="-b=br0" #Or write data directly echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker Docker custom bridge #Install bridge tools yum install bridge-utils #Add a bridge brctl addbr br0 # View the bridge brctl show #Set the bridge address and subnet mask ifconfig br0 192.168.110.1 netmask 255.255.255.0 #Set up the bridge echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker #Configure Docker vi /usr/lib/systemd/system/docker.service #Add our own configuration file EnvironmentFile=-/etc/sysconfig/docker #Application parameters ExecStart=/usr/bin/dockerd-current \ --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ --default-runtime=docker-runc \ --exec-opt native.cgroupdriver=systemd \ --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ $OPTIONS \ $DOCKER_STORAGE_OPTIONS \ $DOCKER_NETWORK_OPTIONS \ $ADD_REGISTRY \ $BLOCK_REGISTRY \ $INSECURE_REGISTRY \ $DOCKER_OPTS #Add bridge parameters #Reload systemctl daemon-reload #Restart the docker service service docker restart Bridge information after successful modification View bridge data After the bridge is modified successfully, the network segment and subnet mask of the network card are modified The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Example of Vue routing listening to dynamically load the same page
>>: 3 methods to restore table structure from frm file in mysql [recommended]
Table of contents 1. Download MySQL 1.1 Download ...
What is an index? Why create an index? Indexes ar...
--Homepage backup 1.txt text 2. Scan the image 3. ...
SQL paging query:background In the company's ...
Problem Description Install nginx on Tencent Clou...
New Questions Come and go in a hurry. It has been...
Preface: This article only introduces the steps t...
Let me first introduce an interesting property - ...
This article takes the connection error ECONNREFU...
1. Build the basic image of jmeter The Dockerfile...
I have been studying and reviewing the developmen...
Compared with vue2, vue3 has an additional concep...
1. Function Mainly used to preserve component sta...
Section Course content Hours 1 Web Design Overvie...
Environmental preparation: VMware+CentOS, jdk 1. ...