Skip to content

Commit

Permalink
fix dockerhub rate limit #519
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Dec 14, 2020
1 parent 10c36e5 commit 7901a2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .ci/drone/Dockerconfig-sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "REPLACE_USER_AND_TOKEN_BASE64"
}
}
}

12 changes: 11 additions & 1 deletion .ci/drone/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
help: ## show help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sed -e 's/^GNUmakefile://' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'


Dockerconfig.json: Makefile
@if [ -z "${DOCKERHUB_DRONE_USER}" ]; then echo need DOCKERHUB_DRONE_USER; exit 1; fi
@if [ -z "${DOCKERHUB_DRONE_TOKEN}" ]; then echo need DOCKERHUB_DRONE_TOKEN; exit 1; fi
echo -n '${DOCKERHUB_DRONE_USER}:${DOCKERHUB_DRONE_TOKEN}' | base64 \
| xargs -I {} sed -e "s/REPLACE_USER_AND_TOKEN_BASE64/{}/g" Dockerconfig-sample.json > Dockerconfig.json

#
# Add Secrets
# Dockerconfig.json : Dockerhub login auth
# https://docs.drone.io/pipeline/docker/syntax/images/#pulling-private-images
#
setup: ## setup drone.io configuration
setup: Dockerconfig.json ## setup drone.io configuration
drone secret update --repository srz-zumix/iutest \
--name dockerconfig \
--data @./Dockerconfig.json || \
drone secret add --repository srz-zumix/iutest \
--name dockerconfig \
--data @./Dockerconfig.json

0 comments on commit 7901a2f

Please sign in to comment.