Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v12.0 #1

Merged
merged 13 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Deploy Docker images
on: workflow_dispatch

concurrency: docker

jobs:
base_image:
name: Build base image
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
build-mount-path: '/var/lib/docker/volumes'
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/educelab/ci-docker
flavor: |
latest=false
tags: |
type=ref,prefix=base.,event=pr
type=semver,prefix=base.,pattern={{version}}
type=semver,prefix=base.,pattern={{major}}.{{minor}}
type=raw,prefix=base.,value=edge,enable={{is_default_branch}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v3
with:
file: ./Dockerfile.base
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=max
cache-from: type=gha

vcdeps_images:
name: Build vc-deps images
runs-on: ubuntu-latest
needs: base_image
strategy:
fail-fast: false
matrix:
type: [static, dynamic]
steps:
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/educelab/ci-docker
flavor: |
latest=false
tags: |
type=ref,prefix={{ matrix.type }}.,event=pr
type=semver,prefix={{ matrix.type }}.,pattern={{version}}
type=semver,prefix={{ matrix.type }}.,pattern={{major}}.{{minor}}
type=raw,value=edge,enable={{is_default_branch}}
type=raw,value=latest,enable={{ is_default_branch && matrix.type == 'static' }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v3
with:
file: ./Dockerfile.{{ matrix.type }}
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=max
cache-from: type=gha
15 changes: 8 additions & 7 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM debian:bullseye-slim
FROM debian:bookworm-slim
MAINTAINER Seth Parker <c.seth.parker@uky.edu>
LABEL org.opencontainers.image.description Base system-provided packages
LABEL org.opencontainers.image.title ci-docker (base)
LABEL org.opencontainers.image.description Base system packages
LABEL org.opencontainers.image.source https://github.com/educelab/ci-docker

# Install apt sources
RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list \
RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/backports.list \
&& apt-get clean && apt-get -y update
RUN apt-get install --fix-missing --fix-broken -y \
build-essential \
Expand Down Expand Up @@ -51,13 +52,13 @@ RUN apt-get install --fix-missing --fix-broken -y \
python3-setuptools \
zlib1g-dev \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& apt-get -t bullseye-backports install -y cmake \
&& apt-get -t bookworm-backports install -y cmake \
&& apt-get purge && rm -rf /var/lib/apt/lists/*

# Install Qt6
RUN curl -O -L https://download.qt.io/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz \
&& tar -xf qt-everywhere-src-6.4.2.tar.xz \
&& cd qt-everywhere-src-6.4.2/ \
RUN curl -O -L https://download.qt.io/archive/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz \
&& tar -xf qt-everywhere-src-6.6.1.tar.xz \
&& cd qt-everywhere-src-6.6.1/ \
&& ./configure -opensource -nomake examples -nomake tests -bundled-xcb-xinput -confirm-license \
&& cmake --build . --parallel \
&& cmake --install . \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.dynamic
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ghcr.io/educelab/ci-docker:11_v2.base
FROM ghcr.io/educelab/ci-docker:base.latest
MAINTAINER Seth Parker <c.seth.parker@uky.edu>
LABEL org.opencontainers.image.title ci-docker (dynamic)
LABEL org.opencontainers.image.description Dynamic vc-deps libraries
LABEL org.opencontainers.image.source https://github.com/educelab/ci-docker

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.static
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ghcr.io/educelab/ci-docker:11_v2.base
FROM ghcr.io/educelab/ci-docker:base.latest
MAINTAINER Seth Parker <c.seth.parker@uky.edu>
LABEL org.opencontainers.image.title ci-docker (static)
LABEL org.opencontainers.image.description Static vc-deps libraries
LABEL org.opencontainers.image.source https://github.com/educelab/ci-docker

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,12 @@ docker buildx create --use
```

## Updating the version
1. Change `VERSION` in [build.sh](build.sh)
2. Update the base image version in the `FROM` command for each of the `Dockerfile.[static|dynamic]` files
Change the version components in [build.sh](build.sh). Values should match the rules
for [semantic versioning](https://semver.org/):

```bash
# build.sh
VER_MAJOR=12
VER_MINOR=0
VER_PATCH=0
```
47 changes: 36 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
#!/bin/bash

set -e

timestamp() {
date -u +'%Y-%m-%dT%H:%M:%SZ'
}

REPO=ghcr.io/educelab/ci-docker
VERSION=11_v2
VER_MAJOR=12
VER_MINOR=0
VER_PATCH=0
VER_FULL=${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}
REV=$(git rev-parse --verify HEAD)

labels() {
echo --label org.opencontainers.image.created=$(timestamp) \
--label org.opencontainers.image.licenses=AGPL-3.0 \
--label org.opencontainers.image.revision=${REV} \
--label org.opencontainers.image.url=https://github.com/educelab/ci-docker \
--label org.opencontainers.image.version=${VER_FULL}
}

docker buildx build --platform linux/amd64,linux/arm64 --push -t ${REPO}:${VERSION}.base -f Dockerfile.base . && \
docker buildx build --platform linux/amd64,linux/arm64 --push -t ${REPO}:${VERSION}.dynamic -f Dockerfile.dynamic . && \
docker buildx build --platform linux/amd64,linux/arm64 --push -t ${REPO}:latest -t ${REPO}:${VERSION}.static -f Dockerfile.static .
tags() {
TYPE=$1
TAGS="--tag ${REPO}:${TYPE}.${VER_FULL} \
--tag ${REPO}:${TYPE}.${VER_MAJOR}.${VER_MINOR} \
--tag ${REPO}:${TYPE}.latest"
if [[ $TYPE == 'static' ]]; then
TAGS="${TAGS} --tag ${REPO}:latest --tag ${REPO}:${VER_FULL} --tag ${REPO}:${VER_MAJOR}.${VER_MINOR}"
fi
echo "${TAGS}"
}

# Extra tags
docker buildx build --platform linux/amd64 --push -t ${REPO}:${VERSION}.base.amd64 -f Dockerfile.base . && \
docker buildx build --platform linux/arm64 --push -t ${REPO}:${VERSION}.base.arm64 -f Dockerfile.base . && \
docker buildx build --platform linux/amd64 --push -t ${REPO}:${VERSION}.static.amd64 -f Dockerfile.static . && \
docker buildx build --platform linux/arm64 --push -t ${REPO}:${VERSION}.static.arm64 -f Dockerfile.static . && \
docker buildx build --platform linux/amd64 --push -t ${REPO}:${VERSION}.dynamic.amd64 -f Dockerfile.dynamic . && \
docker buildx build --platform linux/arm64 --push -t ${REPO}:${VERSION}.dynamic.arm64 -f Dockerfile.dynamic .
echo ========== Building base image ==========
docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push $(labels) $(tags base) -f Dockerfile.base .
echo ========== Building dynamic image ==========
docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push $(labels) $(tags dynamic) -f Dockerfile.dynamic .
echo ========== Building static image ==========
docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push $(labels) $(tags static) -f Dockerfile.static .
echo ========== Done ==========