systemd "docker.socket" missing on todays update
- [x] This is a bug report
- [ ] This is a feature request
- [ ] I searched existing issues before opening this one
Expected behavior
Upgrade to 18.09.0~3-0~debian-stretch works painlessley.
Actual behavior
Upgrade to 18.09.0~3-0~debian-stretch removes the file /lib/systemd/system/docker.socket and does not restart after the upgrade.
Steps to reproduce the behavior
Run apt-get dist-upgrade on a Debian stretch system with an older docker-ce package installed.
Work is in progress to add back socket activation (see docker/docker-ce-packaging#257), which will be either in an upcoming patch release, or in a package update.
Hi Sebastiaan, when will be the upcoming patch release or package update for 18.09.0 CE? Is it a monthly cadence?
Hi Sebastiaan, when will be the upcoming patch release or package update for 18.09.0 CE? Is it a monthly cadence?
I think the goal is to have a release early/mid december, but there are some issues still being looked into that are desirable for inclusion, so the "safe" answer is "when it's done".
There's a workaround for this issue though (see https://github.com/docker/for-linux/issues/476#issuecomment-437210470)
1. the dockerd systemd unit has been modified by the user. If the unit file is modified, it won't be updated with the latest version that ships with the rpm/deb package (rpm/deb will detect it's modified and will leave it untouched); never modify the systemd unit file itself, but use a "drop-in" file (override file) to customise the unit file.
correct. Ubuntu 16.04: Without an existing /etc/systemd/system/docker.service: Upgrading from 18.06.1-ce to 18.09.0 is no problem
Running systemctl edit --full docker.service and adding just a comment before the upgrade will break the upgrade-process. And here is the diff after the upgrade:
# diff /etc/systemd/system/docker.service /lib/systemd/system/docker.service
After=network-online.target docker.socket firewalld.service | BindsTo=containerd.service
> After=network-online.target firewalld.service
Requires=docker.socket <
ExecStart=/usr/bin/dockerd -H fd:// | ExecStart=/usr/bin/dockerd -H unix://
LimitNOFILE=1048576 | TimeoutSec=0
> RestartSec=2
> Restart=always
>
> # Note that StartLimit* options were moved from "Service" to
> # Both the old, and new location are accepted by systemd 229
> # to make them work for either version of systemd.
> StartLimitBurst=3
>
> # Note that StartLimitInterval was renamed to StartLimitInter
> # Both the old, and new name are accepted by systemd 230 and
> # this option work for either version of systemd.
> StartLimitInterval=60s
>
> LimitNOFILE=infinity
# Uncomment TasksMax if your systemd version supports it. |
# Only systemd 226 and above support this version. | # Comment TasksMax if your systemd version does not supports
> # Only systemd 226 and above support this option.
TimeoutStartSec=0 |
>
# restart the docker process if it exits prematurely <
Restart=on-failure <
StartLimitBurst=3 <
StartLimitInterval=60s <
<
# just a comment to check the upgrade process <
//edit: Seems like using the override-mechanism using systemctl edit (without using --full) is the better way to do.
//edit: Seems like using the override-mechanism using
systemctl edit(without using--full) is the better way to do.
This is in fact another workaround, which will help to successfully upgrade to 18.09.
systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/docker.service.d └─override.conf Active: active (running) since Wed 2018-12-05 15:32:16 CET; 39s ago Docs: https://docs.docker.com Main PID: 58181 (dockerd) Tasks: 13 Memory: 40.0M CPU: 456ms CGroup: /system.slice/docker.service └─58181 /usr/bin/dockerd -H unix://
Dec 05 15:32:15 docker-single-host systemd[1]: Starting Docker Application Container Engine... Dec 05 15:32:16 docker-single-host systemd[1]: Started Docker Application Container Engine.
umm any news update the next update? docker wont run since november without this workarounds and this rly suxx for new users :X
Maybe include systemd integration tests before releasing a new version?
There's tests for this, but unfortunately, the problem with the daemon failing to start won't manifest it self on a fresh install, and only will only be an issue if;
- the dockerd systemd unit has been modified by the user. If the unit file is modified, it won't be updated with the latest version that ships with the rpm/deb package (rpm/deb will detect it's modified and will leave it untouched); never modify the systemd unit file itself, but use a "drop-in" file (override file) to customise the unit file. However;
- if you used a systemd drop-in file, and that file has an
ExecStartwithdockerd -H fd://, the service will fail to start, as it won't be able to connect to a socket created by systemd.If you're in situation 1.;
The unmodified systemd unit file that ships with Docker 18.09.0 can be found here; https://github.com/docker/docker-ce/blob/v18.09.0/components/packaging/systemd/docker.service
If you're in situation 2.:
If you need socket activation; restore the docker.socket unit-file from the 18.06 release; https://github.com/docker/docker-ce/blob/18.06/components/packaging/deb/systemd/docker.socket
If you don't need socket activation; either:
- remove the
-H fd://from theExecStart(if you don't have other-Hoptions set)- change to
-H unix://instead.Work is in progress to add back socket activation (see docker/docker-ce-packaging#257), which will be either in an upcoming patch release, or in a package update.
This post put me on the right path, but I had to dig some more. It appears there are multiple files that use the -H fd:// syntax, which is no longer supported.
In addition to /etc/systemd/system/docker.service.d/override.conf , if you are using insecure registries you may alternately have a /etc/systemd/system/docker.service.d/insecure-registry.conf that also uses the old unsupported syntax. Change the -H fd:// to -H unix:// as stated , then:
sudo systemctl daemon-reload
sudo systemctl start docker.service
I said for new users.
I recently prepared a complete new sd card with rasbian for a pi 3b+ and docker did not work without workarounds. Nothing modified, it was a completly clean Installation.
So both situations mentions above wont work. Only my workaround did work which i posted some hundrets comments above 😃
Why the shit is this still missing 2 months after it's been reported? This completely broke my CentOS install...
From #moby-project on docker community slack:

Splitting packaging updates from actual docker releases is also in the works, but of course requires an overhaul of the release infra.
Anyone know when the the stable release will be updated?
Release is already, stable packages have been uploaded. Closing this issue now.
18.09.1 was released yesterday, so it should be there
Getting similar errors starting the service. That is not to say I am not being stupid though.
Seems to work fine for me once I enable/start the socket
~/notes eli@derry
❯ systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411085015Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411114902Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, CONNECTING" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411137709Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:16 derry dockerd[18322]: time="2019-01-10T22:19:16.158060345Z" level=warning msg="grpc: addrConn.transportMonitor exits due to: context canceled" module=grpc
Jan 10 22:19:23 derry dockerd[18322]: time="2019-01-10T22:19:23.885790737Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:19:28 derry dockerd[18322]: time="2019-01-10T22:19:28.074556524Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:28:19 derry systemd[1]: Stopping Docker Application Container Engine...
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.770089595Z" level=info msg="Processing signal 'terminated'"
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.772797456Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd na>
Jan 10 22:28:19 derry systemd[1]: Stopped Docker Application Container Engine.
~/notes eli@derry
❯ sudo systemctl enable docker.socket
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /usr/lib/systemd/system/docker.socket.
~/notes eli@derry
❯ sudo systemctl start docker.socket
~/notes eli@derry
❯ systemctl status docker.socket
● docker.socket - Docker Socket for the API
Loaded: loaded (/usr/lib/systemd/system/docker.socket; enabled; vendor preset: disabled)
Active: active (listening) since Thu 2019-01-10 22:28:59 UTC; 5s ago
Listen: /var/run/docker.sock (Stream)
Tasks: 0 (limit: 4915)
Memory: 0B
CGroup: /system.slice/docker.socket
Jan 10 22:28:59 derry systemd[1]: Starting Docker Socket for the API.
Jan 10 22:28:59 derry systemd[1]: Listening on Docker Socket for the API.
~/notes eli@derry
❯ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411085015Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411114902Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, CONNECTING" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411137709Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:16 derry dockerd[18322]: time="2019-01-10T22:19:16.158060345Z" level=warning msg="grpc: addrConn.transportMonitor exits due to: context canceled" module=grpc
Jan 10 22:19:23 derry dockerd[18322]: time="2019-01-10T22:19:23.885790737Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:19:28 derry dockerd[18322]: time="2019-01-10T22:19:28.074556524Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:28:19 derry systemd[1]: Stopping Docker Application Container Engine...
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.770089595Z" level=info msg="Processing signal 'terminated'"
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.772797456Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd na>
Jan 10 22:28:19 derry systemd[1]: Stopped Docker Application Container Engine.
~/notes eli@derry
❯ docker version
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:43 2019
OS/Arch: linux/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:06:30 2019
OS/Arch: linux/amd64
Experimental: true
Can anyone confirm that CentOS stable works now from performing a simple yum update? There's a reason we tried to trust the RHEL side of the ecosystem...
did not receive on rasbian till now :S
docker-ce ist schon die neueste Version (5:18.09.0~3-0~raspbian-stretch).
(already newest version)
cat /etc/apt/sources.list.d/docker.list
deb [arch=armhf] https://download.docker.com/linux/raspbian stretch edge
after 4 months, still not possible to install and run docker on a fresh rasbian without a workaround.
if needed i can grant ssh access to the devs.
docker-socket was still missing
sudo curl https://raw.githubusercontent.com/docker/docker-ce-packaging/master/systemd/docker.socket -o /lib/systemd/system/docker.socket
pi@Pi0W-01:~ $ curl -sSL https://get.docker.com | sh
# Executing docker install script, commit: 40b1b76
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sudo -E sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian stretch edge" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker pi
Remember that you will have to log out and back in for this to take effect!
WARNING: Adding a user to the "docker" group will grant the ability to run
containers which can be used to obtain root privileges on the
docker host.
Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
for more information.
** DOCKER ENGINE - ENTERPRISE **
If you’re ready for production workloads, Docker Engine - Enterprise also includes:
* SLA-backed technical support
* Extended lifecycle maintenance policy for patches and hotfixes
* Access to certified ecosystem content
** Learn more at https://dockr.ly/engine2 **
ACTIVATE your own engine to Docker Engine - Enterprise using:
sudo docker engine activate
pi@Pi0W-01:~ $ sudo usermod -aG docker pi
pi@Pi0W-01:~ $ sudo docker run -d -p 5555:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/pi/Docker/Portainer/data:/data --name=Portainer --restart=unless-stopped portainer/portainer
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
pi@Pi0W-01:~ $ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
On Debian 9:
$ sudo aptitude install docker-ce
[sudo] password for burkov:
The following partially installed packages will be configured:
docker-ce
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up docker-ce (5:18.09.3~3-0~debian-stretch) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
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 Sat 2019-03-02 10:15:54 CET; 12ms ago
Docs: https://docs.docker.com
Process: 31971 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 31971 (code=exited, status=1/FAILURE)
CPU: 170ms
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: Failed to start Docker Application Container Engine.
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: docker.service: Unit entered failed state.
Mar 02 10:15:54 debian-2gb-nbg1-1 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)
Setting up docker-ce (5:18.09.3~3-0~debian-stretch) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
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 Sat 2019-03-02 10:15:57 CET; 15ms ago
Docs: https://docs.docker.com
Process: 32081 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 32081 (code=exited, status=1/FAILURE)
CPU: 119ms
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: Failed to start Docker Application Container Engine.
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: docker.service: Unit entered failed state.
Mar 02 10:15:57 debian-2gb-nbg1-1 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
Can you check the logs for docker.service and containerd.service? Unfortunately the output of systemd is usually not showing the actual error (other than: it failed to start)