ci: login to Harbor before buildx
This commit is contained in:
parent
0ae7cc17d8
commit
46ff29ae1c
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -37,6 +37,8 @@ spec:
|
|||||||
value: tcp://localhost:2375
|
value: tcp://localhost:2375
|
||||||
- name: DOCKER_TLS_CERTDIR
|
- name: DOCKER_TLS_CERTDIR
|
||||||
value: ""
|
value: ""
|
||||||
|
- name: DOCKER_CONFIG
|
||||||
|
value: /root/.docker
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace-volume
|
- name: workspace-volume
|
||||||
mountPath: /home/jenkins/agent
|
mountPath: /home/jenkins/agent
|
||||||
@ -138,6 +140,11 @@ PY
|
|||||||
apk add --no-cache bash git jq
|
apk add --no-cache bash git jq
|
||||||
mkdir -p /root/.docker
|
mkdir -p /root/.docker
|
||||||
cp /docker-config/config.json /root/.docker/config.json
|
cp /docker-config/config.json /root/.docker/config.json
|
||||||
|
echo "Docker config: ${DOCKER_CONFIG:-unset} HOME=${HOME:-unset}"
|
||||||
|
REGISTRY_HOST="registry.bstein.dev"
|
||||||
|
USERNAME=$(jq -r ".auths[\\"${REGISTRY_HOST}\\"].username" /root/.docker/config.json)
|
||||||
|
PASSWORD=$(jq -r ".auths[\\"${REGISTRY_HOST}\\"].password" /root/.docker/config.json)
|
||||||
|
echo "${PASSWORD}" | docker login "${REGISTRY_HOST}" -u "${USERNAME}" --password-stdin
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user