Commit b84b8882 authored by Kevin Daudt's avatar Kevin Daudt

docker-image: specify docker password through stdin

Instead of supplying it as an argument, pass it through stdin so that
the password will not be visible in the process output.

Add validation that the password has been specified as well.
parent 19c48e4e
Pipeline #2756 passed with stage
in 34 seconds
image: alpinelinux/docker-cli:latest
.docker-login: &docker-login |-
[ -z "$DOCKER_PASSWORD" ] && { echo "Please specify \$DOCKER_PASSWORD"; exit 120; }
printf "$DOCKER_PASSWORD" | docker login -u $DOCKER_USER --password-stdin
stages:
- build
- upload
......@@ -88,7 +92,7 @@ build-armv7:
- master
- tags
before_script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- *docker-login
- gunzip -c docker-images/${CI_PROJECT_NAME}_latest-${ARCH}.tar.gz | docker image load
script:
- >
......@@ -179,7 +183,7 @@ create-manifest:
- docker-alpine
- ci-docker-image
before_script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- *docker-login
- for image in docker-images/*.tar.gz; do gunzip -c "$image" | docker image load; done
script:
- >
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment