From 599230fe0c65ab54433fb9ded5a39e2da98dff36 Mon Sep 17 00:00:00 2001 From: Alexander Varwijk Date: Wed, 28 Jun 2023 15:07:30 +0200 Subject: [PATCH] Add chrome and solr images with build system We create a build system that automatically builds our images in different versions so that we can easily use them in our CI and update when needed. We create a workflow per image so that we only rebuild the image that's actually been updated. The images we add is a copy of `kingdutch/social-docker-chrome` as it's currently being used as well as a new SOLR image which matches what we use in our development docker-compose but is needed for the CI to be able to use SOLR as we can't change the entrypoint from the GitHub workflow configuration. --- .github/workflows/build-chrome.yml | 56 ++++++++++++++++++++++++++++++ .github/workflows/build-solr.yml | 55 +++++++++++++++++++++++++++++ README.md | 7 ++++ chrome/Dockerfile | 9 +++++ solr/Dockerfile | 5 +++ 5 files changed, 132 insertions(+) create mode 100644 .github/workflows/build-chrome.yml create mode 100644 .github/workflows/build-solr.yml create mode 100644 README.md create mode 100644 chrome/Dockerfile create mode 100644 solr/Dockerfile diff --git a/.github/workflows/build-chrome.yml b/.github/workflows/build-chrome.yml new file mode 100644 index 0000000..7fada4c --- /dev/null +++ b/.github/workflows/build-chrome.yml @@ -0,0 +1,56 @@ +name: Tag and release Chrome image + +on: + push: + paths: + - "chrome/**" + branches: + - 'main' + +env: + SUBDIRECTORY: chrome + REGISTRY: ghcr.io + IMAGE_NAME: goalgorilla/ci-chrome + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + strategy: + matrix: + version: + - 102 + - 108 + - 112 + - latest + + # There should be no need to edit below this line. + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v4 + with: + build-args: + - VERSION=${{ matrix.version }} + context: "{{defaultContext}}:${{ env.SUBDIRECTORY }}" + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }} + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/build-solr.yml b/.github/workflows/build-solr.yml new file mode 100644 index 0000000..3684282 --- /dev/null +++ b/.github/workflows/build-solr.yml @@ -0,0 +1,55 @@ +name: Tag and release Solr image + +on: + push: + paths: + - "solr/**" + branches: + - 'main' + +env: + SUBDIRECTORY: solr + REGISTRY: ghcr.io + IMAGE_NAME: goalgorilla/ci-solr + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + strategy: + matrix: + version: + - "8.11" + - "9" + - latest + + # There should be no need to edit below this line. + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v4 + with: + build-args: + - VERSION=${{ matrix.version }} + context: "{{defaultContext}}:${{ env.SUBDIRECTORY }}" + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }} + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ab1c5a --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# CI Images + +This repository contains images that are used in our CI processes. +For example to change the entry point for Chrome or SOLR. + +This repository does not include output docker images such as those containing product or project +code. diff --git a/chrome/Dockerfile b/chrome/Dockerfile new file mode 100644 index 0000000..c7c04a7 --- /dev/null +++ b/chrome/Dockerfile @@ -0,0 +1,9 @@ +ARG VERSION=latest + +FROM zenika/alpine-chrome:$VERSION + +# Disables GPU hardware acceleration. If software renderer is not in place, then the GPU process won't launch. +# Disables the sandbox for all process types that are normally sandboxed. Meant to be used as a browser-level switch for testing purposes only. +# Enables remote debug over HTTP on the specified port. +# Enables remote debug over HTTP on the specified port. +CMD ["--disable-gpu", "--no-sandbox", "--remote-debugging-address=0.0.0.0", "-remote-debugging-port=9222"] diff --git a/solr/Dockerfile b/solr/Dockerfile new file mode 100644 index 0000000..caa83c2 --- /dev/null +++ b/solr/Dockerfile @@ -0,0 +1,5 @@ +ARG VERSION=latest + +FROM solr:$VERSION + +ENTRYPOINT ["solr-precreate", "drupal", "/solr-conf"]