Skip to content

Commit 14cc1af

Browse files
committed
Use stdin to provide password
1 parent 891240c commit 14cc1af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.buildkite/hooks/pre-command

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ if [[ "${USE_PROD_DOCKER_CREDENTIALS:-}" == "true" ]]; then
9494
fi
9595
fi
9696

97+
# Authenticate to the Docker Hub public read-only registry
9798
if which docker > /dev/null 2>&1; then
9899
DOCKERHUB_REGISTRY_USERNAME="$(vault read -field=username secret/ci/elastic-elasticsearch/docker_hub_public_ro_credentials)"
99100
DOCKERHUB_REGISTRY_PASSWORD="$(vault read -field=password secret/ci/elastic-elasticsearch/docker_hub_public_ro_credentials)"
100101

101-
docker login --username "$DOCKERHUB_REGISTRY_USERNAME" --password "$DOCKERHUB_REGISTRY_PASSWORD" docker.io
102+
echo "$DOCKERHUB_REGISTRY_PASSWORD" | docker login --username "$DOCKERHUB_REGISTRY_USERNAME" --password-stdin docker.io
102103
fi
103104

104105
if [[ "$BUILDKITE_AGENT_META_DATA_PROVIDER" != *"k8s"* ]]; then

0 commit comments

Comments
 (0)