[why] some repositories need username and password, but we don't know. And the problem is, it will block there as we have no username and password.
Add GIT_ASKPASS=/kill-parent.sh, will kill the block one, and go to next repository.
Signed-off-by: Li Yuanchao lyc163mail@163.com --- container/git-mirror/Dockerfile | 3 +++ container/git-mirror/kill-parent.sh | 3 +++ container/git-mirror/start | 1 + 3 files changed, 7 insertions(+) create mode 100755 container/git-mirror/kill-parent.sh
diff --git a/container/git-mirror/Dockerfile b/container/git-mirror/Dockerfile index 390bbcc..1180a7b 100644 --- a/container/git-mirror/Dockerfile +++ b/container/git-mirror/Dockerfile @@ -2,6 +2,9 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
FROM alpine:3.8 +MAINTAINER Li Yuanchao lyc163mail@163.com + +ADD kill-parent.sh /
RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com%7Cg' /etc/apk/repositories
diff --git a/container/git-mirror/kill-parent.sh b/container/git-mirror/kill-parent.sh new file mode 100755 index 0000000..6418592 --- /dev/null +++ b/container/git-mirror/kill-parent.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +kill $PPID diff --git a/container/git-mirror/start b/container/git-mirror/start index dd4fd63..ee79578 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -17,6 +17,7 @@ cmd = %W[ -d -e CCI_SRC=#{DOCKER_CCI} -e REPO_SRC=#{DOCKER_REPO} + -e GIT_ASKPASS=/kill-parent.sh -v #{ENV['CCI_SRC']}:#{DOCKER_CCI} -v /etc/localtime:/etc/localtime:ro -v #{ENV['REPO_SRC']}:#{DOCKER_REPO}