modify docker daemon configuration in Rancher Desktop VM
Asked Answered
S

3

8

Is there a way to modify docker daemon configuration in Rancher Desktop VM, e.g. adding insecure registries, etc...?

After such modification, I'd like to restart docker daemon for changes to apply. Is there a way to connect to Rancher Desktop VM?

Haven't found anything relevant in https://docs.rancherdesktop.io/faq

Shot answered 3/2, 2022 at 12:56 Comment(0)
S
6

Based on this answer :

  • Log into Lima VM:
LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl" shell 0
  • Add insecure registry to DOCKER_OPTS at /etc/conf.d/docker file.

So it would look like below:

lima-rancher-desktop:~# tail -1 /etc/conf.d/docker
DOCKER_OPTS="--insecure-registry=insecure.home:80"
  • Restart docker service inside LimaVM or restart Rancher Desktop.
Shot answered 8/2, 2022 at 11:16 Comment(2)
restart with sudo rebootDrynurse
This configuration isn't persisted for me. Every time I restart Rancher Desktop, the line I added is gone again, and the file is back to its default. (The same is actually the case for any other configuration file I try modifying, such as /etc/resolv.conf and /etc/wsl.conf). What am I doing wrong?Agglomerate
P
4

Rancher Desktop starts clean VM on restart, Resulting in loss of changes done in shell session.

Recently I had similar requirement where I wanted to customize docker opts

Following provisioning config of lima helped persisted daemon.json file.

# location $HOME/Library/Application\ Support/rancher-desktop/lima/_config/override.yaml

provision:
- mode: system
  script: |
    #!/bin/sh
    cat <<'EOF' > /etc/docker/daemon.json
    {
      "max-concurrent-downloads":16,
      "max-concurrent-uploads": 16,
      "insecure-registry": "insecure.home:80"
    }
    EOF

Source: Official Docs

Perfect answered 30/8, 2023 at 14:10 Comment(1)
Notice Windows uses another provisioning tooling, refer to Official Docs specific section about it!Freemon
K
3

On Windows to log in to the Rancher Desktop VM, you can do:

wsl -d rancher-desktop -e /bin/sh
Kilkenny answered 31/3, 2022 at 19:14 Comment(1)
Useful to diagnose and confirm provisioning script operates as expectedFreemon

© 2022 - 2024 — McMap. All rights reserved.