wsl2のubuntu22でdockerのコンテナが動かない
問題
wsl2のubuntu22で、docker run すると、iptablesがどうのこうのというエラーで動かないです。
# docker start xxxxxxxx ERRO[0000] error loading cached network config: network "podman" not found in CNI cache WARN[0000] falling back to loading from existing plugins on disk ERRO[0000] Error tearing down partially created network namespace for container eab8ab3c5049e38fdc34435604c7f609a3be90f882564f0cd1e3dc5e8dae483c: error removing pod stupefied_lumiere_stupefied_lumiere from CNI network "podman": running [/usr/sbin/iptables -t nat -D POSTROUTING -s 10.88.0.31 -j CNI-8cef29197ace749014a994c2 -m comment --comment name: "podman" id: "eab8ab3c5049e38fdc34435604c7f609a3be90f882564f0cd1e3dc5e8dae483c" --wait]: exit status 2: iptables v1.8.7 (nf_tables): Couldn't load match `comment':No such file or directory Try `iptables -h' or 'iptables --help' for more information. Error: unable to start container "eab8ab3c5049e38fdc34435604c7f609a3be90f882564f0cd1e3dc5e8dae483c": error configuring network namespace for container eab8ab3c5049e38fdc34435604c7f609a3be90f882564f0cd1e3dc5e8dae483c: error adding pod stupefied_lumiere_stupefied_lumiere to CNI network "podman": running [/usr/sbin/iptables -t nat -C CNI-8cef29197ace749014a994c2 -d 10.88.0.31/16 -j ACCEPT -m comment --comment name: "podman" id: "eab8ab3c5049e38fdc34435604c7f609a3be90f882564f0cd1e3dc5e8dae483c" --wait]: exit status 2: iptables v1.8.7 (nf_tables): Couldn't load match `comment':No such file or directory Try `iptables -h' or 'iptables --help' for more information.
答え
以下を実行するとよい。
update-alternatives --set iptables /usr/sbin/iptables-legacy update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
なお、rootlessの時は出ない。rootで実行すると出る。
コメント