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]: Azurite commands are not overridden. #1352

Closed
MatthiasHuygelen opened this issue Jan 27, 2025 · 1 comment
Closed

[Bug]: Azurite commands are not overridden. #1352

MatthiasHuygelen opened this issue Jan 27, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@MatthiasHuygelen
Copy link

Testcontainers version

4.1.0

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host arch

X86

.NET version

9.0.101

Docker version

Docker version 24.0.5, build ced0996

Docker info

Client:
 Version:    24.0.5
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.20.2-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.6
    Path:     C:\Program Files\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:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  0.20.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 19
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.167.4-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 15.47GiB
 Name: docker-desktop
 ID: d80301b0-770d-4fbf-a57d-200cab367c25
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support

What happened?

The WithCommand documentation states, 'Overrides the container's command arguments,' but instead, they are appended to the command list.

AzuriteBuilder.init()

 protected override AzuriteBuilder Init()
 {
     return base.Init()
         .WithImage(AzuriteImage)
         .WithPortBinding(BlobPort, true)
         .WithPortBinding(QueuePort, true)
         .WithPortBinding(TablePort, true)
         .WithEntrypoint("azurite")
         .WithCommand("--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0");
 }

My code

AzuriteBuilder()
            .WithNetwork(Network)
            .WithEntrypoint("/bin/sh", "-c")
            .WithCommand(
                "apk add ca-certificates",
                "update-ca-certificates")
            .Build();

result

DockerResourceConfiguration.Command
{string[8]}
    [0]: "--blobHost"
    [1]: "0.0.0.0"
    [2]: "--queueHost"
    [3]: "0.0.0.0"
    [4]: "--tableHost"
    [5]: "0.0.0.0"
    [6]: "apk add ca-certificates"
    [7]: "update-ca-certificates"

Expected

DockerResourceConfiguration.Command
{string[2]}
    [0]: "apk add ca-certificates"
    [1]: "update-ca-certificates"

Relevant log output

Additional information

No response

@MatthiasHuygelen MatthiasHuygelen added the bug Something isn't working label Jan 27, 2025
@HofmeisterAn
Copy link
Collaborator

I will close this enhancement/issue as a duplicate: #1227. This behavior applies to the container builder in general and how it handles enumerators. We could likely adjust the builder so that a list argument overrides the existing configuration, or we may need a separate API specifically for overriding enumerators.

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