Skip to content

Issue with the --username option in docker login when using --password-stdin #5792

@aminelch

Description

@aminelch

Description

There seems to be an issue with the usage of docker login when providing the --username and --password-stdin options. The --username option is being ignored or misinterpreted when placed after --password-stdin. Based on the official documentation, it should work in this order, but it leads to an error message when executed in this sequence.

Reproduce

Use the following command to log in to a Docker registry:

$ echo "$TARGET_GITLAB_PAT" | docker login -u "$TARGET_GITLAB_USERNAME" --password-stdin registry.gitlab.com
Must provide --username with --password-stdin
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1

Image

Expected behavior

Expected Behavior: The --username and --password-stdin options should work regardless of their order, as the documentation clearly specifies both options.

docker version

NA

docker info

NA

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions