Support network options on `Network`

Open
#1,535 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

@Mario-Mohar is already working on this.

Since Nov 10, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, node.js, typescript
Domain
devtools, testing

Research direction

Start with packages/testcontainers/src/network/network.ts and read how Network.start() builds the network options and how GenericContainer implements builder methods. Check the existing network tests and run them to understand coverage for names, drivers, IPv6, labels, and IPAM. Done means callers can configure the requested network settings through Network while existing tests still pass.

Written by the indexing model from the issue text.

Description

enhancement minor

What happens

new Network() takes no options. Every setting is hardcoded in Network.start():

Driver: "bridge",
Internal: false,
Attachable: false,
Ingress: false,
EnableIPv6: false,
CheckDuplicate: true,

The name is always a random UUID and the labels are fixed. The constructor's only parameter is a Uuid used by tests.

Things that cannot be done today:

  • an internal network, to test behaviour without outbound access
  • IPv6
  • a custom driver, or driver options
  • a fixed subnet (IPAM)
  • a readable name or extra labels

Expected

Builder methods on Network in the same style as GenericContainer, for example withName, withDriver, withInternal, withIpv6, withLabels.

Where

packages/testcontainers/src/network/network.ts.

Notes

  • Java has Network.builder() with driver, enableIpv6 and createNetworkCmdModifier. Go has network.New(ctx, opts...) with WithDriver, WithInternal, WithLabels, WithIPAM and WithAttachable.
  • The constructor's Uuid parameter is in the way of a conventional options argument.

Dependencies

  • Nothing blocks this. It can start now.
Dominant language
TypeScript
Stars
2.7k
Forks
290
Avg merge
4d 1h
Merged PRs (30d)
22

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testcontainers/testcontainers-node

All issues in testcontainers/testcontainers-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.