testcontainers / testcontainers/testcontainers-java

[Bug]: dockerConfigFile property file not used

Open
#10,362 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Testcontainers version

1.19.8

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host Arch

x86

Docker version
podman
What happened?

When trying to configure authentication, it seems that the documentation is misleading:

It says:

Use DOCKER_CONFIG_FILE environment variable.
export DOCKER_CONFIG_FILE=/some/location/config.json
Use dockerConfigFile java property
java -DdockerConfigFile=/some/location/config.json

here: https://java.testcontainers.org/modules/docker_compose/#using-private-repositories-in-docker-compose

But: dockerConfigFile is not used.
and it looks like you should not use DOCKER_CONFIG_FILE, but DOCKER_AUTH_CONFIG instead.

Not having the ability to use a system property is annoyng, since it makes it diffucult to configure docker authentication with java code directly.

That's what I infer from: https://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/utility/RegistryAuthLocator.java and from my tests.

Relevant log output

Additional Information

No response

Contributor guide

Open the contributing guide

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.

Research direction

Start with core/src/main/java/org/testcontainers/utility/RegistryAuthLocator.java and compare its configuration handling with the Docker Compose documentation at the referenced page. Determine why dockerConfigFile is not used, then verify that the documented configuration options, including Java system-property configuration, work consistently for Docker authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, java
Domain
authentication, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.