Docker network issues when using Rancher Desktop on Mac with Apple Silicon ARM-based processor (M1 chip)
When pulling image (e.g. docker run hello-world
) or signing to the Docker Hub (docker login
) the following error occurs:
Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io.
To fix the issue, change DNS server adress for the linux virtual machine instance: lime-vm
Open Terminal app and run:
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/mackankowski/be575ec0b81fd8ba3a948d3e84410adc/raw/979b09ab2cc6225ddee1aedaf9e893bb839a715a/script.sh)"
The script file is also available here: script.sh
Open the terminal and follow the instructions:
- Run the internal lime-vm shell from the Rancher Desktop instance:
LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl" shell 0
- Set permissions to edit the DNS configuration file:
sudo chown $(whoami) /etc/resolv.conf
(or sudo chmod 777 /etc/resolv.conf
)
- Replace DNS server address with 8.8.8.8:
sudo sed -i 's/nameserver.*/nameserver 8.8.8.8/g' /etc/resolv.conf
- Type
exit
to quit the shell.
An alternative way (recommended) for using Docker on the macOS is Colima:
Guide: https://gist.github.com/mackankowski/7b6b1d861359d31b8a28195432d86d4d