diff --git a/.gitea/workflows/alpine.yaml b/.gitea/workflows/alpine.yaml index 1f811f4..48b211f 100644 --- a/.gitea/workflows/alpine.yaml +++ b/.gitea/workflows/alpine.yaml @@ -16,25 +16,26 @@ jobs: strategy: matrix: # version: ${{ fromJson(needs.prepare.outputs.versions) }} - version: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - - "3.15" - - "3.16" - - "3.17" - - "3.18" - - "3.19" - - "3.20" - - "3.21" - - "edge" + params: + - version: "3.5" + - version: "3.6" + - version: "3.7" + - version: "3.8" + - version: "3.9" + - version: "3.10" + - version: "3.11" + - version: "3.12" + - version: "3.13" + - version: "3.14" + - version: "3.15" + - version: "3.16" + - version: "3.17" + - version: "3.18" + - version: "3.19" + - version: "3.20" + - version: "3.21" + latest: "true" + - version: "edge" steps: - name: Check out repository code uses: actions/checkout@v4 @@ -48,55 +49,32 @@ jobs: # uses: docker/setup-qemu-action@v3 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 - - name: Build and push container image + - if: ${{ matrix.params.latest != 'true' }} + name: Build and push alpine linux container image uses: docker/build-push-action@v5 with: # platforms: linux/amd64,linux/arm64 push: true context: . build-args: | - ALPINE_VERSION=${{ matrix.version }} + OS_VERSION=${{ matrix.params.version }} tags: | - quay.io/sindigilive/alpine:${{ matrix.version }} - # - name: Scan container image with Trivy - # uses: aquasecurity/trivy-action@0.20.0 - # with: - # image-ref: 'quay.io/sindigilive/alpine:${{ matrix.version }}' - # format: 'sarif' - # output: 'trivy-results.sarif' - - build-latest: - name: Build latest alpine linux container images - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - runs-on: ubuntu-latest - needs: - - prepare - - build - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Login to quay.io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - name: Build latest version + quay.io/teras/alpine:${{ matrix.params.version }} + - if: ${{ matrix.params.latest == 'true' }} + name: Build and push container image uses: docker/build-push-action@v5 with: # platforms: linux/amd64,linux/arm64 push: true context: . + build-args: | + OS_VERSION=${{ matrix.params.version }} tags: | - quay.io/sindigilive/alpine:latest + quay.io/teras/alpine:${{ matrix.version }} + quay.io/teras/alpine:latest # - name: Scan container image with Trivy # uses: aquasecurity/trivy-action@0.20.0 # with: - # image-ref: 'quay.io/sindigilive/alpine:latest' + # image-ref: 'quay.io/teras/alpine:${{ matrix.version }}' # format: 'sarif' # output: 'trivy-results.sarif' diff --git a/Dockerfile b/Dockerfile index 5c1ae56..4ec62a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -ARG ALPINE_VERSION=3.21 +ARG OS_VERSION=3.21 -FROM alpine:${ALPINE_VERSION} AS builder +FROM docker.io/alpine:${OS_VERSION} AS builder -ARG ALPINE_VERSION=3.21 +ARG OS_VERSION=3.21 ARG TZ=Asia/Jakarta # Set User as root @@ -20,18 +20,18 @@ RUN /sbin/apk update --no-cache; \ FROM scratch -ARG ALPINE_VERSION=3.21 +ARG OS_VERSION=3.21 LABEL maintainer="Muhamad Aditya Prima " LABEL name="alpine" -LABEL version="${ALPINE_VERSION}" +LABEL version="${OS_VERSION}" LABEL distribution-scope="public" #labels for container catalog -LABEL summary="Alpine Linux ${ALPINE_VERSION} container image" -LABEL description="Provide latest release of Alpine Linux ${ALPINE_VERSION} container base image" +LABEL summary="Alpine Linux ${OS_VERSION} container image" +LABEL description="Provide latest release of Alpine Linux ${OS_VERSION} container base image" LABEL io.k8s.description="Very small alpine linux container image" -LABEL io.k8s.display-name="Alpine Linux ${ALPINE_VERSION}" +LABEL io.k8s.display-name="Alpine Linux ${OS_VERSION}" COPY --from=builder / /