Skip to content

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

Backlog

Description

@DicksonWu654

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.

Activity

  1. MikeFTV commented on Nov 28, 2026

    @MikeFTV

    I reproduced this on current main (FOO/bar gets an empty registry and assertValid() throws) and have a small fix with tests. I will open a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions