Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accidently deleted docker0 bridge. How do i get docker running again ? #312

Open
1 of 3 tasks
Jenil2910 opened this issue May 21, 2018 · 4 comments
Open
1 of 3 tasks

Comments

@Jenil2910
Copy link

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

I accidently deleted the docker0 bridge and now i cannot get docker running by any means.
Following are the things i have tried:

  • Create new bridge as per
    https://www.ibm.com/developerworks/community/blogs/powermeup/entry/Setting_up_a_Docker_Bridge?lang=en
  • Reinstall docker-ce as per
    https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-from-a-package
  • Some stackexchange answers

But nothing seems to work. Is there a way i can get docker runnning again ?

Reinstallation attempt

I tried reinstalling as per https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1,
But no luck.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
docker-ce is already the newest version (18.03.1~ce-0~ubuntu).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up docker-ce (18.03.1~ce-0~ubuntu) ...
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2018-05-21 15:57:16 IST; 3ms ago
     Docs: https://docs.docker.com
  Process: 8278 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 8278 (code=exited, status=1/FAILURE)

May 21 15:57:16 <user> systemd[1]: Failed to start Docker Application Container Engine.
May 21 15:57:16 <user> systemd[1]: docker.service: Unit entered failed state.
May 21 15:57:16 <user> systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

Steps to reproduce the behavior

To reproduce,

ip link delete docker0
docker run hello-world

Output of docker version:

Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:17:20 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Output of docker info:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Additional environment details (AWS, VirtualBox, physical, etc.)
None particular, only Ubuntu 16.04 with GNOME

@cpuguy83
Copy link
Collaborator

Can you paste the logs: journalctl -fu docker

@hamzawix
Copy link

hamzawix commented May 28, 2018

Try creating a new bridged network interface and restart the docker service:
go to /etc/network/interfaces and add these lines:
auto docker0
iface docker0 inet static
address 172.17.0.1
netmask 255.255.255.0
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
then:
sudo systemctl restart networking
then restart docker service:
sudo systemctl restart docker

good luck

@pkaramol
Copy link

Thanks to @hamzawix for the solution since I run to the same issue accident myself;

I just added the above lines in a new file as in /etc/network/interfaces.d/dockerif

@chinthaka-dinadasa
Copy link

Restarting docker service solved the issue

sudo service docker restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants