Skip to content

[Enhancement]: Add ability to supply network to ryuk container #8167

Open

Description

@vkravets

Module

Core

Synopsis

This is required due to one aspect of rootless podman networking:

https://docs.podman.io/en/latest/markdown/podman-run.1.html#network-mode-net
Screenshot 2024-01-29 at 20 44 31

This implies that network is not picked up when runnig podman in rooless mode thus making it impossible for ryuk to communicate with other containers even if they were started with --network=bridge network

Proposal

Tescontainer can run using custom network (auto created via Network.createNetwork() or external) and ryuk in this case cannot be customized to use the same custom network. Some environmet can have restrictions on default network, or even have different access to each other. In this case ryuk could not see the containers at all.

Since Testcontainer already has custom env varible to override some functionality will be great to have custom varible to define:

  • custom expose port for ryuk
  • custom network name which ryuk container should connect during creation

Workaround in this case disable ryuk only.

Activity

  1. changed the title [-][Enhancement]: Add ability to custom ryuk container[/-] [+][Enhancement]: Add ability to customize ryuk container[/+] on Jan 29, 2024
  2. changed the title [-][Enhancement]: Add ability to customize ryuk container[/-] [+][Enhancement]: Add ability to supply network to ryuk container[/+] on Jan 29, 2024
  3. ChaosWars commented on May 27, 2024

    @ChaosWars

    This would also help on VSCode devcontainers. Currently the only way to solve this issue is to disable ryuk and calling .withNetworkMode(network), supplying the devcontainer bridge network as the parameter.

  4. kiview commented on May 27, 2024

    @kiview
    Member

    @ChaosWars Can you please elaborate on the devcontainer issue? Wouldn't the devcontainer run using Docker socket mounting, so having Testcontainers containers as sibling containers?

    @vkravets As of now, we don't intend to add Podman-specific changes to the project, but we have good experiences with opening such topics up with the Podman project, since they generally want to get closer to the drop-in Docker replacement claim, and this is clearly a difference in behavior.

  5. Kelavandoril commented on Aug 1, 2026

    @Kelavandoril

    @kiview I've messed around with ryuk and podman and it seems that the fundamental issue is rootless containers. Podman can be (mostly) a drop-in when running rootful though. I'm trying to work on getting rootless somewhat functional in a fork; if I were to submit a PR to the Ryuk repo eventually for adding this functionality, could I ask for a review?

  6. Inf1mum commented on Nov 4, 2026

    @Inf1mum

    I'd like to work on this on the Java side, keeping Ryuk's startup behavior unchanged unless explicitly configured.

    Proposed property: ryuk.container.network (follows the existing ryuk.container.* convention, cf. ryuk.container.image, ryuk.container.privileged, ryuk.container.timeout)

    Semantics:

    • Unset (default): no behavior change — Ryuk keeps running on the default network exactly as today.
    • Set: the Ryuk container is attached to the given pre-existing network (as its network mode) instead of the default bridge, so Ryuk can see and clean up containers running in custom networks — rootless Podman, devcontainers, or environments where the default network is restricted.

    The connection from the test JVM to Ryuk keeps working through the already published port (getHost() + mapped port), so nothing changes there.

    The issue also mentions a custom exposed port for Ryuk. I'd suggest keeping this change to the network property only for now; if there are environments that also need a fixed published port for Ryuk, I'm happy to extend it.

    Feedback welcome — if there are no objections, I'll open a PR implementing ryuk.container.network with docs and unit tests.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions