Skip to content

Commit

Permalink
specify version of docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathchandra24 committed Mar 3, 2024
1 parent 68000b1 commit 1310ba5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-op-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
- build-image-metadata
uses: ./.github/workflows/call-scan-images.yaml
with:
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}"
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}:${{ needs.build-image-metadata.outputs.version }}"
source_registry: ghcr.io
platforms: '["linux/arm64", "linux/amd64"]'
secrets:
Expand All @@ -123,7 +123,7 @@ jobs:
- scan-operator-image
- build-image-metadata
with:
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}"
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}:${{ needs.build-image-metadata.outputs.version }}"
source_registry: ghcr.io
target_image: ${{ needs.build-image-metadata.outputs.DOCKER_IMG_NAME }}
target_registry: docker.io
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/call-clone-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,19 @@
needs: check-image-exists
runs-on: ubuntu-latest
steps:
- name: Login to Docker Registry
run: |
echo "${{ secrets.target_registry_token }}" | docker login ${{ inputs.target_registry }} -u ${{ secrets.target_registry_username }} --password-stdin
mkdir -p $HOME/.docker
cp ~/.docker/config.json $HOME/.docker/auth.json
env:
DOCKER_CONFIG: /home/runner/work/_temp/.docker

- name: Promote container images from ${{ inputs.source_registry }} to ${{ inputs.target_registry }}
run: |
echo "Promoting $SOURCE_IMAGE to $RELEASE_IMAGE"
docker run --rm \
-v $HOME/.docker:/root/.docker \
quay.io/skopeo/stable:latest \
copy \
--all \
Expand All @@ -87,4 +96,3 @@
SOURCE_IMAGE: ${{ inputs.source_registry }}/${{ inputs.source_image }}
RELEASE_IMAGE: ${{ inputs.target_registry }}/${{ inputs.target_image }}
RELEASE_CREDS: ${{ secrets.target_registry_username }}:${{ secrets.target_registry_token }}

6 changes: 5 additions & 1 deletion .github/workflows/call-scan-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
registry: ${{ inputs.source_registry }}
username: ${{ secrets.registry_username }}
password: ${{ secrets.registry_password }}


- name: check docker image exists
run: |
docker pull ${{ inputs.source_registry }}/${{ inputs.source_image }}
- name: Trivy - multi-arch
uses: aquasecurity/[email protected]
with:
Expand Down

0 comments on commit 1310ba5

Please sign in to comment.