Follow the given steps to modify the docker.service file:
- Execute the following command to edit the docker.service file:
sudo nano /lib/systemd/system/docker.service
- Inside the docker.service file, go to the line containing ExecStart=.
- Set the value of ExecStart= as shown:
ExecStart=/usr/bin/docker daemon -H fd:// -H tcp://0.0.0.0:4243
- The preceding setting will bind the Docker server to the Unix socket. Furthermore, on TCP port 4243. 0.0.0.0, it makes the Docker engine accept connections from anywhere.
If you want your Docker server to accept connections from only your Jenkins server, replace 0.0.0.0 with your Jenkins server IP.
- Execute the following command to make the Docker daemon notice the ...