File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ backends:
86
86
# Manually pass specific environment variables
87
87
environment :
88
88
CI : ' $(HOST: echo $CI)'
89
+ DOCKERHUB_MIRROR : ' $(HOST: echo $DOCKERHUB_MIRROR)'
89
90
systems :
90
91
- ubuntu-24.04 :
91
92
username : runner
@@ -123,6 +124,26 @@ prepare: |
123
124
cd "$SPREAD_PATH"
124
125
# Install via snap after https://github.com/canonical/concierge/pull/81 released
125
126
go install github.com/canonical/concierge@latest
127
+
128
+ if [[ -n "$DOCKERHUB_MIRROR" ]]
129
+ then
130
+ # Running on IS-hosted runner; configure microk8s to use Docker Hub mirror
131
+ # Run before concierge prepare because of https://github.com/canonical/concierge/issues/75
132
+
133
+ snap install microk8s --channel "$CONCIERGE_MICROK8S_CHANNEL"
134
+
135
+ # Wait for microk8s to populate iptables
136
+ # https://chat.canonical.com/canonical/pl/jo5cg6wqjjrudqd5ybj6hhttee
137
+ microk8s status --wait-ready
138
+
139
+ tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml << EOF
140
+ server = "$DOCKERHUB_MIRROR"
141
+ [host."${DOCKERHUB_MIRROR#'https://'}"]
142
+ capabilities = ["pull", "resolve"]
143
+ EOF
144
+ microk8s stop
145
+ microk8s start
146
+ fi
126
147
127
148
# Install charmcraft & pipx on lxd-vm backend and install pipx on IS-hosted runners
128
149
~/go/bin/concierge prepare --trace
You can’t perform that action at this time.
0 commit comments