I am trying to write an automation script to install docker in CentOS with a bip configuration using docker daemon file. However, the docker directory /etc/docker/
is not created till the time docker service is started after installation. So, currently i need to create /etc/docker/daemon.json
file and then restart the docker service to get the desired subnet for daemon.
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
ls -ltr /etc/docker
ls: cannot access /etc/docker: No such file or directory
sudo systemctl start docker
ls -ltr /etc/docker
total 4
-rw-------. 1 root root 244 Sep 16 15:05 key.json
Is there any way, i could configure bip before the first start of docker service. As once docker service is up, it acquires the default subnet(172.17.0.1/16) and requires two start of docker service for base setup.