[Bug]: DockerImageName treats uppercase registry names as repository paths

Open Beginner friendly
#12,186 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@MikeFTV is already working on this.

Since Nov 28, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, java
Domain
backend, testing

Research direction

Start with core/src/main/java/org/testcontainers/utility/DockerImageName.java, especially the registry split described in the issue, and compare its behavior with Docker's splitDockerDomain rule. Look for existing DockerImageName tests and run the relevant tests for FOO/bar, Foo/bar, and LOCALDOMAIN/fooo. Done means these uppercase first path components are parsed as registries and assertValid() succeeds.

Written by the indexing model from the issue text.

Description

Module

Core

Testcontainers version

I checked the published 2.0.5 release and current main at commit a736c02500bb8cd8fffb68ec88f8ddbbffd7e80d.

Using the latest Testcontainers version?

Yes. Maven Central currently lists 2.0.5 as the latest release.

Host OS

Ubuntu 24.04

Host Arch

x86_64

Docker version

Docker CLI 29.7.2. This parser call does not use the daemon.

What happened?

DockerImageName.parse("FOO/bar") leaves the registry empty, and assertValid() throws IllegalArgumentException:

import org.testcontainers.utility.DockerImageName;

DockerImageName image = DockerImageName.parse("FOO/bar");
System.out.println(image.getRegistry());
image.assertValid();

I see the same result for Foo/bar, LOCALDOMAIN/fooo, and LOCALDOMAIN/fooo/bar.

Relevant log output

No Docker log is produced because parsing fails before any engine call.

Additional Information

Docker's splitDockerDomain treats an uppercase first path component as a registry (v0.6.0 rule). The 2.0.5 registry split only recognizes a dot, a colon, or exact localhost.

Dominant language
Java
Stars
8.8k
Forks
2k
Avg merge
2d 1h
Merged PRs (30d)
11

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-java

All issues in testcontainers/testcontainers-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.