From 8f2713670ca9aa729798c3c2d30c18fe8e3b014e Mon Sep 17 00:00:00 2001 From: Jimmy Herrera Date: Tue, 31 Dec 2024 10:47:37 +0100 Subject: [PATCH] fix: [#34] added extra step to retrieve the registry content --- .github/workflows/docker-registry.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-registry.yml b/.github/workflows/docker-registry.yml index f67460f..5837ef4 100644 --- a/.github/workflows/docker-registry.yml +++ b/.github/workflows/docker-registry.yml @@ -13,9 +13,10 @@ permissions: contents: read packages: write env: + BUILD_IMAGE_NAME: mcvs-registry DOCKERFILE_CONTEXT: ./registry - IMAGE_MANIFEST_LIST: datadog/agent:7.59.0 - IMAGE_MANIFEST_SINGLE: nginx/nginx:1.27.0 + IMAGE_MANIFEST_LIST: nginx/nginx:1.27.0-alpine + IMAGE_MANIFEST_SINGLE: nginx/nginx:1.27.0-alpine-slim-amd64 REGCTL_VERSION: v0.8.0 REGISTRY_LOCAL: localhost:5000 REGISTRY_REMOTE: public.ecr.aws @@ -37,11 +38,11 @@ jobs: - name: Create registry backup directory run: mkdir -p ${{ env.DOCKERFILE_CONTEXT }}/backup-registry - name: Pull images data and prepare context directory - if: startsWith(github.ref, 'refs/tags/') shell: bash run: | #!/bin/bash + # run local registry docker run -d \ -p 5000:5000 \ --name mcvs-registry-tmp \ @@ -80,3 +81,18 @@ jobs: dockle-accept-key: "curl,HOME,libcrypto3,libssl3,PATH" images: ghcr.io/${{ github.repository }}/${{ matrix.build-args }} token: ${{ secrets.GITHUB_TOKEN }} + - name: Get new registry catalog + if: ${{ github.event_name == 'pull_request' }} + shell: bash + run: | + #!/bin/bash + docker images + + docker run -d \ + -p 5005:5000 \ + --name mcvs-registry \ + ghcr.io/${{ github.repository }}/${{ env.BUILD_IMAGE_NAME }}:pr-${{ github.event.number }} + + curl --silent http://localhost:5005/v2/_catalog + + docker rm --force mcvs-registry