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

virtualisation.docker.enableOnBoot = false does not work #213974

Closed
mkg20001 opened this issue Feb 1, 2023 · 2 comments
Closed

virtualisation.docker.enableOnBoot = false does not work #213974

mkg20001 opened this issue Feb 1, 2023 · 2 comments
Labels
0.kind: bug Something is broken

Comments

@mkg20001
Copy link
Member

mkg20001 commented Feb 1, 2023

Describe the bug

virtualisation.docker.enableOnBoot = false does not work. docker still starts on boot.

Steps To Reproduce

Steps to reproduce the behavior:

  1. add virtualisation.docker.enableOnBoot; virtualisation.docker.enable = true;
  2. apply configuration

Expected behavior

docker doesn't start on boot, wantedby not set

Screenshots

image

Additional context

Problem is that wantedBy is set by the systemd service file shipped with docker. nixos would have to either disable wantedby with wantedby= or strip it from the service file

Also note that it has been broken for some time, so changing the default for enableOnBoot to true might make sense, since it'll prob confuse users

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.0, NixOS, 23.05 (Stoat), 23.05.20221221.da32bb6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(maciej): `""`
 - nixpkgs: `/nix/store/zrxfs7nrz1ylllgmnhpjy4za0aiv25mq-source`
@mkg20001 mkg20001 added the 0.kind: bug Something is broken label Feb 1, 2023
@emilylange
Copy link
Member

Also note that it has been broken for some time, so changing the default for enableOnBoot to true might make sense, since it'll prob confuse users

enableOnBoot's default is already true 👀
See #21326

Problem is that wantedBy is set by the systemd service file shipped with docker.

WantedBy= in the packaged unit file doesn't actually do anything.
See #81138 and https://discourse.nixos.org/t/disable-a-systemd-service-while-having-it-in-nixoss-conf/12732/3

Note that due to docker.socket, docker.service will start as soon as you interact with the socket, which includes almost every command from the docker cli.

Can you elaborate on how you checked whether docker is auto-starting?
Because I can't reproduce what you are describing :(

@emilylange
Copy link
Member

Closing due to @mkg20001 not responding and the reasons outlined in my previous comment.

Feel free to reopen, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants