@@ -19,6 +19,7 @@ init_arch() {
1919
2020function clean_before_exit {
2121 # delay before exiting, so stdout/stderr flushes through the logging system
22+ rm -rf /tmp/drycc-values.yaml /etc/rancher/k3s/registries.yaml
2223 sleep 3
2324}
2425trap clean_before_exit EXIT
@@ -51,22 +52,20 @@ function configure_mirrors {
5152mirrors:
5253 "docker.io":
5354 endpoint:
54- - "https://hub-mirror.c.163.com"
55- - "https://mirror.baidubce.com"
56- - "https://docker-mirror.drycc.cc:1443"
57- - "https://registry-1.docker.io"
55+ - "https://docker-mirror.drycc.cc"
56+ - "https://registry-1.docker.io"
5857 "quay.io":
5958 endpoint:
60- - "https://quay-mirror.drycc.cc:1443 "
61- - "https://quay.io"
59+ - "https://quay-mirror.drycc.cc"
60+ - "https://quay.io"
6261 "gcr.io":
6362 endpoint:
64- - "https://gcr-mirror.drycc.cc:1443 "
65- - "https://gcr.io"
63+ - "https://gcr-mirror.drycc.cc"
64+ - "https://gcr.io"
6665 "k8s.gcr.io":
6766 endpoint:
68- - "https://k8s-mirror.drycc.cc:1443 "
69- - "https://k8s.gcr.io"
67+ - "https://k8s-mirror.drycc.cc"
68+ - "https://k8s.gcr.io"
7069EOF
7170 INSTALL_K3S_MIRROR=" ${INSTALL_DRYCC_MIRROR} "
7271 export INSTALL_K3S_MIRROR
@@ -165,7 +164,33 @@ function install_drycc {
165164
166165 RABBITMQ_USERNAME=$( cat /proc/sys/kernel/random/uuid)
167166 RABBITMQ_PASSWORD=$( cat /proc/sys/kernel/random/uuid)
168-
167+ if [[ " ${INSTALL_DRYCC_MIRROR} " == " cn" ]] ; then
168+ cat << EOF > "/tmp/drycc-values.yaml"
169+ imagebuilder:
170+ container_registries: |
171+ unqualified-search-registries = ["docker.io"]
172+ short-name-mode="permissive"
173+ [[registry]]
174+ prefix = "docker.io"
175+ location = "docker-mirror.drycc.cc"
176+ [[registry]]
177+ prefix = "quay.io"
178+ location = "quay-mirror.drycc.cc"
179+ [[registry]]
180+ prefix = "gcr.io"
181+ location = "gcr-mirror.drycc.cc"
182+ [[registry]]
183+ prefix = "k8s.gcr.io"
184+ location = "k8s-mirror.drycc.cc"
185+ EOF
186+ else
187+ cat << EOF > "/tmp/drycc-values.yaml"
188+ imagebuilder:
189+ container_registries: |
190+ unqualified-search-registries = ["docker.io"]
191+ short-name-mode="permissive"
192+ EOF
193+ fi
169194 helm install drycc drycc/workflow \
170195 --set builder.service.type=LoadBalancer \
171196 --set global.cluster_domain=" cluster.local" \
@@ -190,6 +215,7 @@ function install_drycc {
190215 --set passport.admin_username=${DRYCC_ADMIN_USERNAME} \
191216 --set passport.admin_password=${DRYCC_ADMIN_PASSWORD} \
192217 --namespace drycc \
218+ --values /tmp/drycc-values.yaml \
193219 --create-namespace --wait --timeout 30m0s
194220 echo -e " \\ 033[32m---> Rabbitmq username: $RABBITMQ_USERNAME \\ 033[0m"
195221 echo -e " \\ 033[32m---> Rabbitmq password: $RABBITMQ_PASSWORD \\ 033[0m"
0 commit comments