ceph*build: Login to docker.io if needed
# dockerhub started aggressively rate limiting in November 2020. We can use an internal docker mirror if the builder is in the upstream lab.
use_internal_container_registry() {
- if curl -s "https://docker-mirror.front.sepia.ceph.com:5000"; then
+ if curl -s -k "https://docker-mirror.front.sepia.ceph.com:5000"; then
REGISTRY="docker-mirror.front.sepia.ceph.com:5000/library"
else
+ if [ -n "${DOCKER_HUB_USERNAME}" ] && [ -n "${DOCKER_HUB_PASSWORD}" ]; then
+ docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" docker.io
+ fi
REGISTRY="docker.io"
fi
}