From d98cfe54abbbade0fdfb0ab7d96df3f214cc15d3 Mon Sep 17 00:00:00 2001 From: Barry d'Hoine Date: Sun, 17 Nov 2024 01:22:55 +0100 Subject: [PATCH] Add initial Dockerfile and workflow --- .github/workflows/build.yml | 48 +++++++++++++++++++++++++++++++++++++ .gitignore | 1 + Dockerfile | 13 ++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8055ee4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Create and publish a Docker image + +on: + push: + branches: ["main"] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5b77652 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM azul/zulu-openjdk:11-jre-headless AS java-base-image + +# Install lsof as it is added to the patched AEM stop script +RUN apt-get update &&\ + apt-get install -y --no-install-recommends lsof &&\ + rm -rf /var/lib/apt/lists/* + +# Installer layer to extract and start AEM +FROM java-base-image AS installer + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends ca-certificates curl jq lsof &&\ + rm -rf /var/lib/apt/lists/* \