Skip to content
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

[Bug]: Building a container which uses a Network on Windows give error #1322

Open
StefH opened this issue Dec 21, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@StefH
Copy link

StefH commented Dec 21, 2024

Testcontainers version

4.0.0

Using the latest Testcontainers version?

No

Host OS

Windows

Host arch

x86

.NET version

8.0

Docker version

Client:
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:42:27 2024
 OS/Arch:           windows/amd64
 Context:           desktop-windows

Server: Docker Desktop 4.36.0 (175267)
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Fri Sep 20 11:40:58 2024
  OS/Arch:          windows/amd64
  Experimental:     false

Docker info

Client:
 Version:    27.3.1
 Context:    desktop-windows
 Debug Mode: false
 Plugins:
  ai: Ask Gordon - Docker Agent (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-ai.exe
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.18.0-desktop.2
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.30.3-desktop.1
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.15
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.15.0
    Path:     C:\Users\StefHeyenrath\.docker\cli-plugins\docker-scout.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 27
 Server Version: 27.3.1
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 26100 (26100.1.amd64fre.ge_release.240331-1435)
 Operating System: Microsoft Windows Version 24H2 (OS Build 26100.2605)
 OSType: windows
 Architecture: x86_64
 CPUs: 14
 Total Memory: 31.51GiB
 Name: TP-PF4XH40V
 ID: 47e6bf0a-6172-44e0-b66b-8add84bf1629
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Labels:
  com.docker.desktop.address=npipe://\\.\pipe\docker_cli
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

What happened?

When using NetworkBuilder and use this in a container build and build the container, I get this error on Windows:
Docker.DotNet.DockerApiException : Docker API responded with status code=NotFound, response={"message":"could not find plugin bridge in v1 plugin registry: plugin not found"}

C# code:

var dummyNetwork = new NetworkBuilder()
    .WithName("Dummy Network for TestcontainersTests")
    .WithCleanUp(true)
    .Build();

var wireMockContainer = new WireMockContainerBuilder()
    .WithNetwork(dummyNetwork)
    .WithWatchStaticMappings(true)
    .WithAutoRemove(true)
    .WithCleanUp(true)
    .Build();

Relevant log output

Additional information

No response

@StefH StefH added the bug Something isn't working label Dec 21, 2024
@StefH StefH changed the title [Bug]: [Bug]: Building a container which uses a Network on Windows give error Dec 21, 2024
@HofmeisterAn
Copy link
Collaborator

IIRC the bridge driver is not available for WCOW. I think you need to set the driver to nat.

WithCreateParameterModifier(m => m.Driver = "nat")

Something we can add to NetworkDriver too (then you can use WithDriver(NetworkDriver)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants