Skip to content

Commit aebfc85

Browse files
authored
Merge pull request #351 from infosiftr/modprobe-iptables
Invoke "modprobe ip_tables" if "iptables -L" fails
2 parents 4472768 + 0efba9e commit aebfc85

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

20.10/dind/dockerd-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dockerd-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ if [ "$1" = 'dockerd' ]; then
143143
set -- docker-init -- "$@"
144144
fi
145145

146+
if ! iptables -nL > /dev/null 2>&1; then
147+
# if iptables fails to run, chances are high the necessary kernel modules aren't loaded (perhaps the host is using nftables with the translating "iptables" wrappers, for example)
148+
# https://github.com/docker-library/docker/issues/350
149+
# https://github.com/moby/moby/issues/26824
150+
modprobe ip_tables || :
151+
fi
152+
146153
uid="$(id -u)"
147154
if [ "$uid" != '0' ]; then
148155
# if we're not root, we must be trying to run rootless

0 commit comments

Comments
 (0)