Skip to content

Docker Custom Image #17

Docker Custom Image

Docker Custom Image #17

name: Docker Custom Image
on:
workflow_dispatch:
inputs:
tag_suffix:
description: "Tag suffix i.e. portability-<suffix>"
required: true
type: string
default: "dev"
boost_ver:
description: "Boost version"
required: true
type: string
default: "1.77.0"
hdf5_ver:
description: "HDF5 version"
required: true
type: string
default: "1.12.1"
petsc_ver:
description: "PETSc version"
required: true
type: string
default: "3.17.5"
sundials_ver:
description: "SUNDIALS version"
required: true
type: string
default: "6.7.0"
vtk_ver:
description: "VTK version"
required: true
type: string
default: "8.2.0"
xercesc_ver:
description: "Xerces-C version"
required: true
type: string
default: "3.2.4"
xsd_ver:
description: "XSD version"
required: true
type: string
default: "4.0.0"
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tags: chaste/runner:portability-${{github.event.inputs.tag_suffix }}
build-args: |
BOOST=${{ github.event.inputs.boost_ver }}
HDF5=${{ github.event.inputs.hdf5_ver }}
PETSC=${{ github.event.inputs.petsc_ver }}
SUNDIALS=${{ github.event.inputs.sundials_ver }}
VTK=${{ github.event.inputs.vtk_ver }}
XERCESC=${{ github.event.inputs.xercesc_ver }}
XSD=${{ github.event.inputs.xsd_ver }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.custom
pull: true
load: true
tags: ${{ matrix.tags }}
build-args: ${{ matrix.build-args }}
- name: Test image
run: |
tags=( ${{ matrix.tags }} )
for tag in "${tags[@]}"; do
docker run --rm --entrypoint /bin/bash ${tag}
done
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.custom
pull: true
push: true
tags: ${{ matrix.tags }}
build-args: ${{ matrix.build-args }}