-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch over to xtables-legacy when nf_tables module isn't available #465
Conversation
PR docker-library#461 updated Alpine to 3.19 and made a change to load the nf_tables kernel module if needed. However, as demonstrated by docker-library#463 and docker-library#464 this might break when the host system doesn't have the nf_tables module available. In that case, we should still try to load the ip_tables module and symlink /sbin/iptables to xtables-legacy-multi. Signed-off-by: Albin Kerouanton <[email protected]>
Nice, thanks for working on this! ❤️ Modifying |
6a47f67
to
e360b4d
Compare
if ! modprobe nf_tables; then | ||
modprobe ip_tables || : | ||
# see https://github.com/docker-library/docker/issues/463 (and the dind Dockerfile where this directory is set up) | ||
export PATH="/usr/local/sbin/.iptables-legacy:$PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice side benefit of this method is that users having trouble with it misfiring (somehow) is that they can just hide this directory somehow like bind-mounting /dev/null
on top of it, and the container will happily continue using the default Alpine-provided iptables
symlink. 👍
e360b4d
to
ff86294
Compare
/ # ls /usr/local/
bin lib share grumble grumble grumble |
…ed symlink farm instead of symlinking over package-provided files in /sbin/ at runtime
ff86294
to
cadf44c
Compare
Changes: - docker-library/docker@7ac5702: Switch over to xtables-legacy when nf_tables module isn't available (docker-library/docker#465)
Follow-up in #468 👀 |
Changes: - docker-library/docker@7ac5702: Switch over to xtables-legacy when nf_tables module isn't available (docker-library/docker#465)
PR #461 updated Alpine to 3.19 and made a change to load the nf_tables kernel module if needed. However, as demonstrated by #463 and #464 this might break when the host system doesn't have the nf_tables module available. In that case, we should still try to load the ip_tables module and symlink /sbin/iptables to xtables-legacy-multi.