dockerd 报错 iptables v1.6.0: can‘t initialize iptables table `nat‘: Table does not exist (do you need

在coreOS中

Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)
error: unexpected EOF

https://github.com/moby/moby/issues/34060

https://github.com/moby/moby/issues/37694

https://github.com/moby/moby/issues/31546

解决

禁用iptables即--iptables=false, iptables默认是开启状态。

https://docs.docker.com/engine/reference/commandline/dockerd/

修改dockerd启动脚本:dockerd-entrypoint.sh

#!/bin/sh
set -e

# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 -o "${1#-}" != "$1" ]; then
	# add our default arguments
	set -- dockerd \
		--host=unix:///var/run/docker.sock \
		--host=tcp://0.0.0.0:2375 \
		--storage-driver=vfs \
           # 禁用iptables
		--iptables=false \
		"$@"
fi

if [ "$1" = 'dockerd' ]; then
	# if we're running Docker, let's pipe through dind
	# (and we'll run dind explicitly with "sh" since its shebang is /bin/bash)
	set -- sh "$(which dind)" "$@"
fi

exec "$@"

猜你喜欢

转载自blog.csdn.net/u010918487/article/details/105850177