How can I edit /etc/default/docker config?

I would like to use own bridge IF which is br0.
I don’t wanna use docker0 bridge IF.
so, I did this to be used br0 bridge on docker instead of docker0 bridge.

echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker

but, it did not work.

Does anyone know how to use own bridge on Docker System.

this is my nixos-config about docker

  virtualisation = {
    docker = {
      enable = true;
#      enable = false;
#      enableNvidia = true;
      extraOptions = ''
        --insecure-registry 192.168.1.1:5000
      '';
    };
  };

/etc/default/docker won’t work because NixOS is systemd-based. Maybe try appending -b=br0 after --insecure-registry 192.168.1.1:5000?

1 Like

Thank you for your reply.

I tried -b=br0 after --insecure-registry 192.168.1.1:5000
but, it did not work…
:frowning:

How exactly have you added it to that field?

Remember that it is space separated string, not newline. Therefore I think using a double-single-quoted string there is misleading.

Also I prefer long switches in scripts and config for readability.

1 Like

extraOption = “–insecure-registry 192.168.1.1:5000 -b=br0”;

It worked !!

Thank you very much.