Skip to content

Commit af4e593

Browse files
authored
github/ci: Workaround broken Docker setup (envoyproxy#43486)
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent 479b41e commit af4e593

2 files changed

Lines changed: 28 additions & 16 deletions

File tree

.github/workflows/_publish_verify.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,9 @@ jobs:
6868
envoy:dev
6969
envoy-contrib:contrib-dev
7070
envoy-google-vrp:google-vrp-dev)
71-
for image in "${IMAGES[@]}"; do
72-
src_name="$(echo ${image} | cut -d: -f1)"
73-
dest_name="$(echo ${image} | cut -d: -f2)"
74-
src="oci-archive:%{{ runner.temp }}/container/build_images/${src_name}.amd64.tar"
75-
dest="docker-daemon:envoyproxy/envoy:${dest_name}"
76-
echo "Copy image: ${src} ${dest}"
77-
skopeo copy -q "${src}" "${dest}"
78-
done
71+
RUNNER_TEMP="%{{ runner.temp }}"
72+
. ./.github/workflows/docker_utils.sh
73+
skopeo_copy "${IMAGES[*]}"
7974
shell: bash
8075
- run: docker images | grep envoy
8176
shell: bash
@@ -131,14 +126,9 @@ jobs:
131126
if [[ "$CONTRIB_DISTROLESS" == "true" ]]; then
132127
IMAGES+=(envoy-contrib-distroless:contrib-distroless-dev)
133128
fi
134-
for image in "${IMAGES[@]}"; do
135-
src_name="$(echo ${image} | cut -d: -f1)"
136-
dest_name="$(echo ${image} | cut -d: -f2)"
137-
src="oci-archive:%{{ runner.temp }}/container/build_images/${src_name}.amd64.tar"
138-
dest="docker-daemon:envoyproxy/envoy:${dest_name}"
139-
echo "Copy image: ${src} ${dest}"
140-
skopeo copy -q "${src}" "${dest}"
141-
done
129+
RUNNER_TEMP="%{{ runner.temp }}"
130+
. ./.github/workflows/docker_utils.sh
131+
skopeo_copy "${IMAGES[*]}"
142132
shell: bash
143133
- run: docker images | grep envoy
144134
shell: bash

.github/workflows/docker_utils.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
6+
skopeo_copy () {
7+
local images tempdir
8+
read -ra images <<< "${1}"
9+
tempdir=$(mktemp -d)
10+
for image in "${images[@]}"; do
11+
src_name="$(echo "${image}" | cut -d: -f1)"
12+
dest_name="$(echo "${image}" | cut -d: -f2)"
13+
src="oci-archive:${RUNNER_TEMP}/container/build_images/${src_name}.amd64.tar"
14+
dest_file="${tempdir}/${dest_name}.amd64.tar"
15+
dest="docker-archive:${dest_file}:envoyproxy/envoy:${dest_name}"
16+
echo "Copy image: ${src} ${dest}"
17+
skopeo copy -q "${src}" "${dest}"
18+
echo "Load docker archive: ${dest_file}"
19+
docker load -i "${dest_file}"
20+
rm -f "${dest_file}"
21+
done
22+
}

0 commit comments

Comments
 (0)