Skip to content

Dockerfile: make sure modprobe is available in dev-container#48992

Closed
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:install_kmod
Closed

Dockerfile: make sure modprobe is available in dev-container#48992
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:install_kmod

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Nov 29, 2024

Depending on the host configuration, the br_netfilter module may not be loaded by default. In this situation, docker will try to load the module through modprobe.

Older versions of docker would silently ignore failing to do so, log a message, and continue;

time="2024-11-29T20:04:58.538404376Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: , error: exec: \"modprobe\": executable file not found in $PATH"

However, starting with db25b0d and 264c15b, we now produce an error, which in our CI situation caused tests to fail:

=== FAIL: libnetwork/drivers/bridge TestCreateFullOptions (0.04s)
time="2024-11-29T19:03:44Z" level=error msg="Running modprobe br_netfilter failed with message: " error="exec: \"modprobe\": executable file not found in $PATH"
    bridge_linux_test.go:280: Failed to create bridge: loadBridgeNetFilterModule failed: cannot restrict inter-container communication: modprobe br_netfilter failed: exec: "modprobe": executable file not found in $PATH

This patch updates the Dockerfile to make sure modprobe is available in the dev-container, which is the environment in which we run out tests.

Following this, we should;

  • Check our packaging to make sure kmod / modprobe is listed as a dependency
  • Look for alternatives / fallbacks for situations where modprobe is not available.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Depending on the host configuration, the `br_netfilter` module may not
be loaded by default. In this situation, docker will try to load the module
through `modprobe`.

Older versions of docker would silently ignore failing to do so, log a message,
and continue;

    time="2024-11-29T20:04:58.538404376Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: , error: exec: \"modprobe\": executable file not found in $PATH"

However, starting with db25b0d and
264c15b, we now produce an error, which
in our CI situation caused tests to fail:

    === FAIL: libnetwork/drivers/bridge TestCreateFullOptions (0.04s)
    time="2024-11-29T19:03:44Z" level=error msg="Running modprobe br_netfilter failed with message: " error="exec: \"modprobe\": executable file not found in $PATH"
        bridge_linux_test.go:280: Failed to create bridge: loadBridgeNetFilterModule failed: cannot restrict inter-container communication: modprobe br_netfilter failed: exec: "modprobe": executable file not found in $PATH

This patch updates the Dockerfile to make sure `modprobe` is available in
the dev-container, which is the environment in which we run out tests.

Following this, we should;

- Check our packaging to make sure `kmod` / `modprobe` is listed as a dependency
- Look for alternatives / fallbacks for situations where `modprobe` is not
  available.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

Arf.. that doesn't work; looks like it's just missing as a whole on the updated machines?

=== RUN   TestCreateFullOptions
time="2024-11-29T20:40:42Z" level=error msg="Running modprobe br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.15.0-1072-aws\n" error="exit status 1"
    bridge_linux_test.go:282: Failed to create bridge: loadBridgeNetFilterModule failed: cannot restrict inter-container communication: modprobe br_netfilter failed: exit status 1
--- FAIL: TestCreateFullOptions (0.05s)

@thaJeztah
Copy link
Copy Markdown
Member Author

@thaJeztah
Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant