Merge pull request #2145 from kinzhi/kinzhi

Fixed dockerfile line feed problem
This commit is contained in:
karmada-bot 2022-07-08 10:33:41 +08:00 committed by GitHub
commit 36dc007eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -669,7 +669,8 @@ function util::set_mirror_registry_for_china_mainland() {
"cluster/images/buildx.Dockerfile"
)
for dockerfile in "${dockerfile_list[@]}"; do
grep 'mirrors.ustc.edu.cn' ${repo_root}/${dockerfile} > /dev/null || sed -i'' -e "s#FROM alpine:3.15.1#FROM alpine:3.15.1\nRUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.15/main/ > /etc/apk/repositories#" ${repo_root}/${dockerfile}
grep 'mirrors.ustc.edu.cn' ${repo_root}/${dockerfile} > /dev/null || sed -i '' -e "1a\\
RUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.15/main/ > /etc/apk/repositories" ${repo_root}/${dockerfile}
done
}