Skip to content

Commit

Permalink
Add chrome and solr images with build system
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kingdutch committed Jun 28, 2023
1 parent cf965ee commit 599230f
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-chrome.yml
Original file line number Diff line number Diff line change
@@ -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 }}
55 changes: 55 additions & 0 deletions .github/workflows/build-solr.yml
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions chrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 5 additions & 0 deletions solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG VERSION=latest

FROM solr:$VERSION

ENTRYPOINT ["solr-precreate", "drupal", "/solr-conf"]

0 comments on commit 599230f

Please sign in to comment.