Skip to content

AuthConfig.password renders non-repeatable container hash #1806

@s-kramer

Description

@s-kramer

This issue was originally raised for testcontainers library: testcontainers/testcontainers-java#2515 (comment)

When using docker credHelpers you can get different different passwords for the same container, which prevents reuse.

I'm basing this on checking the docker command just before the hash is calculated (org.testcontainers.containers.GenericContainer#hash). I've run the following command and observed that only the authConfig.password part was changed in the command between some of the runs.

System.err.println("docker command: " + ((DefaultDockerClientConfig) dockerClientConfig).getObjectMapper().copy().enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY).enable(     SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS).writeValueAsString(createCommand));

I'm using docker-java 3.2.12, testcontainers-postgresql 1.16.2. I'm running docker images authorized using gcloud auth configure-docker which renders .docker/config.json with credHelpers set to gcloud for all URLs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions