testcontainers-go: [Regression]: no basic auth credentials when attempting to pull ryuk image

Testcontainers version

0.34.0

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host arch

arm

Go version

1.23

Docker version

Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.44 (downgraded from 1.47)
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:41:19 2024
 OS/Arch:           linux/arm64
 Context:           default
Server: Docker Engine - Community
 Engine:
  Version:          25.0.0
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       615dfdf
  Built:            Thu Jan 18 17:10:09 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.27
  GitCommit:        a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc:
  Version:          1.1.11
  GitCommit:        v1.1.11-0-g4bccb38
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker info

Client: Docker Engine - Community
 Version:    27.3.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.17.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.7
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
Server:
 Containers: 3
  Running: 2
  Paused: 0
  Stopped: 1
 Images: 8
 Server Version: 25.0.0
 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 splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 4.19.0-25-arm64
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: aarch64
 CPUs: 1
 Total Memory: 7.684GiB
 Name: runner-k8kvlfp3-gitlab-ci-builder-1732008478-36648aa4
 ID: c29b1ee8-408f-43dc-bce9-4398da2b90f6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Labels:
  provider=amazonec2
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
WARNING: No swap limit support

What happened?

The test fails with an authentication error. It happens in a pipeline for a commit that only upgrades the testcontainers-go version

Relevant log output

postgresql_query_repository_test.go:145: generic container: create container: reaper: new reaper: run container: Error response from daemon: Head "https://redacted.dkr.ecr.eu-west-3.amazonaws.com/v2/public/testcontainers/ryuk/manifests/0.10.2": no basic auth credentials

Additional information

This runs before and prints Login succeeded:

aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${DOCKER_REGISTRY}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Unsetting the variable worked. Sorry for wasting your time.

yer it will, if you look it falls through no matter what.

The code has this comment:

// 1. the DOCKER_AUTH_CONFIG environment variable, unmarshalling it into a dockercfg.Config
// 2. the DOCKER_CONFIG environment variable, as the path to the config file
// 3. else it will load the default config file, which is ~/.docker/config.json

Your commit starts with

Handle file not exist error in getDockerAuthConfigs, treating it as if no authentication was provided.

Is the “file” you are talking about ~/.docker/config.json? And if yes, doesn’t that clash with the comment?

The intent is it will just allow us to try the action even if the config file doesn’t exist, just no auth will be provided, instead of hard failing.

Sorry, what log file? The log I get is already in my original message.

The line in the original report looks like a require error from a test. If you run the test in verbose mode it will enable logging which I suspect might add some additional context.