From 5a7a5ab62b749c86a5112917178e27cae5c4faa4 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Mon, 26 Jul 2021 17:38:55 +0200 Subject: [PATCH] Hammer Github Actions; use latest 11 jre --- .dockerignore | 1 + .github/workflows/master-latest.yml | 61 +++++++++++++++++++++++++++++ Dockerfile | 2 +- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/master-latest.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/.github/workflows/master-latest.yml b/.github/workflows/master-latest.yml new file mode 100644 index 0000000..5d3427b --- /dev/null +++ b/.github/workflows/master-latest.yml @@ -0,0 +1,61 @@ +name: master-latest + +on: + push: + branches: [ master ] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildxarch-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildxarch- + + - name: Docker Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} # github username or org + password: ${{ secrets.GITHUB_TOKEN }} # github actions builtin token. repo has to have pkg access. + + - name: Prepare + id: prep + run: | + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest,ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }} + labels: | + org.opencontainers.image.title=${{ github.event.repository.name }} + org.opencontainers.image.description=${{ github.event.repository.description }} + org.opencontainers.image.url=${{ github.event.repository.html_url }} + org.opencontainers.image.source=${{ github.event.repository.clone_url }} + org.opencontainers.image.created=${{ steps.prep.outputs.created }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} + cache-from: type=local,src=/tmp/.buildx-cache/release + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/release + diff --git a/Dockerfile b/Dockerfile index 7f292e1..048b4e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11.0.10-jre-slim +FROM openjdk:11-jre-slim ENV CEREBRO_VERSION 0.9.4