Skip to content

[Bug] Reuse hash changes any time my docker registry token is renewed #5290

Description

@Dayde

Hi,

I have this really weird behaviour where testcontainers are reused but not always. If the container was just started, running my test again never starts a new one, but after a moment, about 5 minutes, it always creates a new one.

A little debugging session led me to the hash method in GenericContainer class.

It appears the createCommand used to generate that hash, contains docker auth elements.
Under the key authConfig, I think the key password contains the docker registry token because the username is _dcgcloud_token (using a google artifact registry as a docker registry).
The token being renewed automatically every now and then it breaks the container reusability.

As I see it we could simply remove this key from the command just before generating the hash, would that make sense to you ?

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