Sample Header Ad - 728x90

How to install and run docker with nix

1 vote
4 answers
4604 views
I'm using Debian on WSL. Nix is already install. I install docker with this command: nix-env -iA nixpkgs.docker I want to start the daemon : systemctl start docker > Failed to connect to bus: No such file or directory **update** FYI $XDG_RUNTIME_DIR= /mnt/wslg/runtime-dir $UID=1000 $DBUS_SESSION_BUS_ADDRESS has no value ls -l /mnt/wslg/runtime-dir >drwx------ 4 pierre pierre 120 Dec 26 00:41 runtime-dir I can access the bus. But I need to use sudo sudo systemctl start docker Now I have this problem > Failed to start docker.service: Unit docker.service not found. I think docker.service is this file: /etc/systemd/system/docker.service But it doesn't exist on my OS. I'Ve tried to uninstall and reinstall docker with nix. To no avails I think that it is linked: https://discourse.nixos.org/t/docker-packages-systemd-unit-files-dont-work-on-ubuntu/12160 sudo cp ~/.nix-profile/etc/systemd/system/docker.service /etc/systemd/system/docker.service sudo cp ~/.nix-profile/etc/systemd/system/docker.sock /var/run/docker.sock sudo systemctl enable docker Failed to start docker.service: Unit docker.socket not found. >Failed to start docker.service: Unit docker.socket not found. After reading this link , I use this command in order to the know where I should replace docker.socket file. : systemctl list-sockets --all But no docker.socket is listed **update I have made all the commands from scratch. Now I have this problem A dependency job for docker.service failed. See 'journalctl -xe' for details.
Asked by Pierre-olivier Gendraud (109 rep)
Dec 26, 2022, 08:05 AM
Last activity: Jun 3, 2025, 10:10 PM