Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(ci): copy release images to TCR with skopeo

tianma-ifbc6fdfdcd403
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index 866f4476..c23794cf 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -188,6 +188,11 @@ jobs:
username: ${{ secrets.TENCENT_TCR_USERNAME }}
password: ${{ secrets.TENCENT_TCR_PASSWORD }}
+ - name: Install registry copy tool
+ run: |
+ sudo apt-get update
+ sudo apt-get install --yes skopeo
+
- name: Build and publish image
uses: docker/build-push-action@v6
with:
@@ -209,9 +214,12 @@ jobs:
while IFS= read -r image_tag; do
[[ -n "${image_tag}" ]] || continue
for attempt in 1 2 3; do
- if docker buildx imagetools create \
- --tag "${TCR_IMAGE_NAME}:${image_tag}" \
- "${GHCR_IMAGE_NAME}:${image_tag}"; then
+ if skopeo copy \
+ --all \
+ --preserve-digests \
+ --authfile "${HOME}/.docker/config.json" \
+ "docker://${GHCR_IMAGE_NAME}:${image_tag}" \
+ "docker://${TCR_IMAGE_NAME}:${image_tag}"; then
break
fi
if [[ "${attempt}" -eq 3 ]]; then
diff --git a/scripts/docker-release.test.mjs b/scripts/docker-release.test.mjs
index 4edb0cd0..faf62252 100644
--- a/scripts/docker-release.test.mjs
+++ b/scripts/docker-release.test.mjs
@@ -85,10 +85,14 @@ describe("Docker release contract", () => {
expect(workflow).toContain("TCR_IMAGE_NAME: ccr.ccs.tencentyun.com/edgeever/edgeever");
expect(workflow).toContain("secrets.TENCENT_TCR_USERNAME");
expect(workflow).toContain("secrets.TENCENT_TCR_PASSWORD");
+ expect(workflow).toContain("sudo apt-get install --yes skopeo");
expect(workflow).toContain("name: Mirror image to Tencent Cloud Container Registry");
- expect(workflow).toContain('docker buildx imagetools create \\');
- expect(workflow).toContain('--tag "${TCR_IMAGE_NAME}:${image_tag}"');
- expect(workflow).toContain('"${GHCR_IMAGE_NAME}:${image_tag}"');
+ expect(workflow).toContain('skopeo copy \\');
+ expect(workflow).toContain("--all");
+ expect(workflow).toContain("--preserve-digests");
+ expect(workflow).toContain('--authfile "${HOME}/.docker/config.json"');
+ expect(workflow).toContain('"docker://${GHCR_IMAGE_NAME}:${image_tag}"');
+ expect(workflow).toContain('"docker://${TCR_IMAGE_NAME}:${image_tag}"');
expect(workflow).toContain("for attempt in 1 2 3; do");
expect(workflow).toContain('Failed to mirror ${image_tag} after ${attempt} attempts');
expect(workflow).toContain('sleep "$((attempt * 15))"');