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. Conventional ideas for time ...
The code demonstrates horizontal merging: <!DO...
Table of contents First, configure package.json T...
Word MySQL 8.0 has been released for four years s...
Sometimes you need to create some test data, base...
html <!DOCTYPE html> <html lang="en...
Overview: I drew lessons from several timetable s...
1. Download the corresponding installation file f...
Preface: I used the official nginx proxy_cache as...
1 Introduction Thread technology was proposed as ...
1. InnoDB storage engine must be used It has bett...
Today, let's introduce several common text pr...
Table of contents 1. Overview 1.1 Usage of queryS...
Specific method: Step 1: Stop the mysql service /...
If Ubuntu is the most popular Linux operating sys...