Skip to content

Commit

Permalink
add other images and apply cosign
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Aug 29, 2024
1 parent a305ff5 commit 84e28ca
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ jobs:
strategy:
matrix:
image:
- target: golang
- name: golang
version: "1.23.0"
version_arg_name: GOLANG_VERSION
- name: node
version: "20.17.0"
- name: postgres
version: "16.4"
runs-on: ubuntu-latest

steps:
Expand All @@ -35,7 +38,7 @@ jobs:
- id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image.target }}
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/re/${{ matrix.image.name }}
tags: |
type=semver,pattern={{version}},value=${{ matrix.image.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ matrix.image.version }}
Expand All @@ -48,17 +51,16 @@ jobs:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
target: ${{ matrix.image.target }}
build-args: ${{ matrix.image.version_arg_name }}=${{ matrix.image.version }}
build-args: IMAGE=${{ matrix.image.name }}:${{ matrix.image.version }}

# - name: Install Cosign
# uses: sigstore/cosign-installer@main
- name: Install Cosign
uses: sigstore/cosign-installer@main

# - name: Sign image with a key
# run: |
# cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAME,,}@${IMAGE_DIGEST} --yes
# env:
# IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# IMAGE_DIGEST: ${{ steps.docker_build.outputs.digest }}
# COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
# COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
- name: Sign image with a key
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAME,,}@${IMAGE_DIGEST} --yes
env:
IMAGE_NAME: ${{ env.REGISTRY }}/${{ github.repository_owner }}/re/${{ matrix.image.name }}
IMAGE_DIGEST: ${{ steps.docker_build.outputs.digest }}
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ARG GOLANG_VERSION
FROM golang:${GOLANG_VERSION} AS golang
ARG IMAGE
FROM ${IMAGE}

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / release (golang, 1.23.0)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / release (node, 20.17.0)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Docker Images Collection

A collection of docker images from docker hub republished to github container repository.

## Adding New Image

Edit [github workflows](./.github/workflows/docker.yml#L15) and add new items containing the docker image name and version
4 changes: 4 additions & 0 deletions cosign.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtCYseinml81/4Ah2GrH2KfXEv1t/
O63Vi/JKvQDB7jOVnSS/gJDIiosu0XNgrad8XNNoN7FWgLgksusIxzVvYA==
-----END PUBLIC KEY-----

0 comments on commit 84e28ca

Please sign in to comment.