From 540c1ba111a545dbbe6dab9a55e690d6fc422d6b Mon Sep 17 00:00:00 2001 From: Tam Mach Date: Sat, 25 Mar 2023 10:22:45 +1100 Subject: [PATCH] docker: Set alternatives for iptables This is to avoid the below issue while starting up docker. ``` Mar 24 22:59:10 ubuntu-jammy dockerd[2820]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Invalid argument ``` Relates: https://github.com/docker/for-linux/issues/1437 --- provision/ubuntu/install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/provision/ubuntu/install.sh b/provision/ubuntu/install.sh index 596ce22..7e55903 100755 --- a/provision/ubuntu/install.sh +++ b/provision/ubuntu/install.sh @@ -157,8 +157,12 @@ cat < /etc/apt/sources.list.d/kubernetes.list deb http://apt.kubernetes.io/ kubernetes-xenial main EOF -# wget https://packages.cloud.google.com/apt/doc/apt-key.gpg -# apt-key add apt-key.gpg +if [ "${NETNEXT}" == "true" ]; then + # Workaround for docker issue with iptables 1.8.7 in newer kernel versions + # https://github.com/docker/for-linux/issues/1437 + update-alternatives --set iptables /usr/sbin/iptables-legacy + update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy +fi #Install packages sudo apt-get update