6

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

rok
  • 9,403
  • 17
  • 70
  • 126

3 Answers3

5

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.
rok
  • 9,403
  • 17
  • 70
  • 126
  • restart with `sudo reboot` – Quanlong Jun 30 '22 at 16:03
  • 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? – Daniel Saner Jun 13 '23 at 12:44
2

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

wsl -d rancher-desktop -e /bin/sh
WPWoodJr
  • 1,155
  • 1
  • 12
  • 16
1

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

Sunny
  • 11
  • 1