Created
October 31, 2022 10:01
-
-
Save saku/5b3afb46c03f2f500a8e018591becfb2 to your computer and use it in GitHub Desktop.
Setting resolve host properly to lima host for Rancher Desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
lima="$HOME/Library/Application Support/rancher-desktop/lima" | |
limactl="/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl" | |
LIMA_HOME="$lima" "$limactl" shell 0 sudo chown $(whoami) /etc/resolv.conf | |
LIMA_HOME="$lima" "$limactl" shell 0 sudo sed -i 's/nameserver.*/nameserver 8.8.8.8/g' /etc/resolv.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
まさかRancher Desktopの中身がlimaだとは思わなかった 😇
そしてなんでデフォで名前解決してくれるようにホストマシンのイメージを作っておいてくれないのか...
ちなみに元情報はこちら
https://qiita.com/Yuppe-jp-eng/items/efa212185679aa3da929
記事中にあったスクリプトはlimaユーザの存在を期待しているようだったのでその部分を
$(whoami)
にしてマシンにログオン中のユーザとして設定するように書き換えただけのものです