From 1a89489d11485c3b72bd74f9833bd0a4b4ee214a Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Tue, 28 Jan 2025 09:54:33 +0100 Subject: [PATCH] rewrote the copy --- .forgejo/workflows/container-build.yml | 9 +++++---- build_container.sh | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/container-build.yml b/.forgejo/workflows/container-build.yml index 1fa43b4..b1ecf0f 100644 --- a/.forgejo/workflows/container-build.yml +++ b/.forgejo/workflows/container-build.yml @@ -16,10 +16,11 @@ jobs: env: REGISTRY_AUTH_FILE: ${{env.RUNNER_TEMP}}/auth.json run: | - skopeo login -u 'user' -p ${{ secrets.DOCKER_TOKEN }} ${GITHUB_SERVER_URL} - sleep 300 - skopeo copy -a --dest-precompute-digests containers-storage:localhost/keycloak:latest ${GITHUB_SERVER_URL//https:/docker:}/${{ env.GITHUB_REPOSITORY }}:latest + skopeo login -u 'user' -p "${{ secrets.DOCKER_TOKEN }}" ${GITHUB_SERVER_URL} + for tag in latest $GITHUB_TAG_NUMBER ; do + skopeo sync -a --dest-precompute-digests dir:image ${GITHUB_SERVER_URL//https:/docker:}/${{ env.GITHUB_REPOSITORY }}:$tag + done - name: Cleanup run: | buildah rmi -f localhost/keycloak - buildah prune -f \ No newline at end of file + podman image prune -f \ No newline at end of file diff --git a/build_container.sh b/build_container.sh index 17457ad..f4a191b 100755 --- a/build_container.sh +++ b/build_container.sh @@ -32,5 +32,4 @@ buildah run -- builder kc.sh build --db=postgres --metrics-enabled=true --https- buildah copy --from builder --chown root:root final /opt/keycloak/ /opt/keycloak/ buildah rm builder -buildah commit -q -f oci --rm final containers-storage:localhost/keycloak:latest -skopeo copy -q containers-storage:localhost/keycloak:latest containers-storage:localhost/keycloak:$GITHUB_RUN_NUMBER \ No newline at end of file +buildah commit --squash -q -f oci --rm final dir:image \ No newline at end of file