diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20dba8f..938424e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,31 +44,11 @@ jobs: run: | echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - # build - docker build \ - --build-arg TAG=${{ matrix.tag }} \ - --tag tgagor/centos:${{ matrix.tag }} ${{ matrix.tag }}/ - - # squash - docker run --name tgagor-${{ matrix.tag }} tgagor/centos:${{ matrix.tag }} true - docker export tgagor-${{ matrix.tag }} | docker import \ - --change 'CMD ["/bin/bash"]' \ - --change 'LABEL maintainer="Tomasz Gągor "' \ - --change 'LABEL org.opencontainers.image.authors="Tomasz Gągor"' \ - --change 'LABEL org.opencontainers.image.licenses=GPL-2.0' \ - --change "LABEL org.opencontainers.image.version=$DOCKER_TAG" \ - --change "LABEL org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \ - --change "LABEL org.opencontainers.image.url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \ - --change "LABEL org.opencontainers.image.revision=$GITHUB_SHA" \ - --change "LABEL org.opencontainers.image.branch=${GITHUB_REF#refs/*/}" \ - --change "LABEL org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - - tgagor/centos:${{ matrix.tag }} - - # tag - docker tag tgagor/centos:${{ matrix.tag }} ghcr.io/tgagor/centos:${{ matrix.tag }}-${{ github.sha }} - - # push - docker push ghcr.io/tgagor/centos:${{ matrix.tag }}-${{ github.sha }} + # fetch template-dockerfiles + curl -sf -o /usr/local/bin/td https://github.com/tgagor/template-dockerfiles/releases/latest/download/td-linux-amd64 + chmod +x /usr/local/bin/td + + td --config build.yaml --tag $DOCKER_TAG --push security-scan: runs-on: ubuntu-22.04 diff --git a/stream9/Dockerfile b/Dockerfile.tpl similarity index 83% rename from stream9/Dockerfile rename to Dockerfile.tpl index 32113f7..620da0b 100644 --- a/stream9/Dockerfile +++ b/Dockerfile.tpl @@ -1,5 +1,4 @@ -ARG TAG=stream -FROM quay.io/centos/centos:$TAG +FROM quay.io/centos/centos:{{ .centos }} # upgrade packages RUN dnf upgrade --setopt=install_weak_deps=False -y && \ diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..8888002 --- /dev/null +++ b/build.yaml @@ -0,0 +1,32 @@ +--- +registry: ghcr.io +prefix: tgagor +maintainer: Tomasz Gągor + +labels: + org.opencontainers.image.licenses: GPL-2.0-only + org.opencontainers.image.url: https://hub.docker.com/repository/docker/tgagor/centos/general + org.opencontainers.image.documentation: https://github.com/tgagor/docker-centos/blob/master/README.md + org.opencontainers.image.title: Weekly updated CentOS Docker images + org.opencontainers.image.description: | + Those images are just standard CentOS base images, but: + + 1. With all the package updates installed weekly. + 2. Squashed to single layer for smaller size. + +images: + centos: + dockerfile: Dockerfile.tpl + variables: + centos: + - stream9 + - stream10 + tags: + - centos:{{ .centos }} + - centos:{{ .centos | trimPrefix "stream" }} + - centos:{{ .tag }}-{{ .centos }} + - centos:{{ .tag }} + - centos:stream + - centos:latest + labels: + org.opencontainers.image.base.name: quay.io/centos/centos:{{ .centos }} diff --git a/stream10 b/stream10 deleted file mode 120000 index 51c76d5..0000000 --- a/stream10 +++ /dev/null @@ -1 +0,0 @@ -stream9 \ No newline at end of file diff --git a/stream10-development b/stream10-development deleted file mode 120000 index 51c76d5..0000000 --- a/stream10-development +++ /dev/null @@ -1 +0,0 @@ -stream9 \ No newline at end of file diff --git a/stream9/stream9 b/stream9/stream9 deleted file mode 120000 index 51c76d5..0000000 --- a/stream9/stream9 +++ /dev/null @@ -1 +0,0 @@ -stream9 \ No newline at end of file