우분투 22.04 이상일 땐
만약 우분투 버전이 22.04 이상이라면, ‘iptables’ 설정을 먼저 변경하고 나서 이후 과정을 따라가야 합니다. 우분투 22.04 버전부터 ‘iptables-nft’가 기본 설정으로 잡혀있어서, WSL에서 도커를 사용할 때 호환성 이슈가 발생합니다. ‘iptables-nft’ 대신 ‘iptables-legacy’를 사용해야 도커 데몬을 실행할 수 있습니다.
우분투 20.04 이하 버전을 WSL에서 사용하시는 분들은 확인만 하고 그냥 넘어가셔도 됩니다.
- Failure to install and run Docker in WSL Ubuntu 22.04 (works in 20.04): “Cannot connect to the Docker daemon”:
- https://github.com/docker/for-linux/issues/1406
$ sudo update-alternatives --config iptables
There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/sbin/iptables-nft 20 auto mode
1 /usr/sbin/iptables-legacy 10 manual mode
2 /usr/sbin/iptables-nft 20 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
댓글