Skip to content

Commit

Permalink
Add action and dockerfile to build CI images
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Aug 28, 2023
1 parent 409005c commit cbd1f07
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/devenv-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build quantlib-devenv Docker images
on:
workflow_dispatch:
inputs:
boostVersion:
description: 'Boost version'
required: true
env:
ROLLING: lunar
jobs:
docker-images:
runs-on: ubuntu-latest
strategy:
matrix:
tag: [lunar, mantic]
steps:
- uses: actions/checkout@v3
- name: Build CI images
working-directory: dockerfiles
run: |
docker build -f ci.Dockerfile \
--build-arg tag=${{ matrix.tag }} \
--build-arg boost_version=${{ github.event.inputs.boostVersion }} \
--build-arg boost_dir=boost_$(echo "${{ github.event.inputs.boostVersion }}" | sed "s/\./_/g") \
-t ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} .
docker tag ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}-${{ github.event.inputs.boostVersion }}
if test "${{ matrix.tag }}" = "$ROLLING" ; then
docker tag ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} ghcr.io/lballabio/quantlib-devenv:rolling
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}-${{ github.event.inputs.boostVersion }}
docker push ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}
if test "${{ matrix.tag }}" = "$ROLLING" ; then
docker push ghcr.io/lballabio/quantlib-devenv:rolling
fi
24 changes: 24 additions & 0 deletions dockerfiles/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG tag=latest
FROM ubuntu:${tag}
MAINTAINER Luigi Ballabio <[email protected]>
LABEL Description="Provide Docker images for QuantLib's CI builds on Linux"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential wget libbz2-dev autoconf automake libtool ccache cmake clang git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ARG boost_version
ARG boost_dir
ENV boost_version ${boost_version}

RUN wget https://boostorg.jfrog.io/artifactory/main/release/${boost_version}/source/${boost_dir}.tar.gz \
&& tar xfz ${boost_dir}.tar.gz \
&& rm ${boost_dir}.tar.gz \
&& cd ${boost_dir} \
&& ./bootstrap.sh \
&& ./b2 --without-python --prefix=/usr -j 4 link=shared runtime-link=shared install \
&& cd .. && rm -rf ${boost_dir} && ldconfig

CMD bash

0 comments on commit cbd1f07

Please sign in to comment.