Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
299ec6e
reduce log level for settings.ini check
jordan-evens Sep 10, 2026
c9a8be7
don't write to .env if already correct
jordan-evens Sep 10, 2026
e94ba70
amd64 only for testing
jordan-evens Sep 15, 2026
e979248
make docker use repo to determine registry to use
jordan-evens Sep 15, 2026
5f212d9
change env.PUBLISH to use bool
jordan-evens Sep 15, 2026
b862363
remove PUBLISH
jordan-evens Sep 15, 2026
726d65c
fix environment variables
jordan-evens Sep 15, 2026
4ee2c3c
fix TARGET
jordan-evens Sep 15, 2026
a78e41f
refactor Dockerfile
jordan-evens Sep 15, 2026
b6dbc19
use single step
jordan-evens Sep 15, 2026
caf8dd6
mount .env rw
jordan-evens Sep 15, 2026
eec0327
export digest
jordan-evens Sep 15, 2026
e131b02
use platforms:
jordan-evens Sep 15, 2026
ebf92be
always build docker
jordan-evens Sep 15, 2026
89177af
use matrix for platforms
jordan-evens Sep 16, 2026
bf022fa
fix target
jordan-evens Sep 16, 2026
12aa2b0
fix target again
jordan-evens Sep 16, 2026
1119bc6
fix digest
jordan-evens Sep 16, 2026
bff74b9
fix artifact name
jordan-evens Sep 16, 2026
0cf7be3
group and label steps
jordan-evens Sep 16, 2026
a2121fb
fix merge
jordan-evens Sep 16, 2026
f6ca0a8
build multiple platforms
jordan-evens Sep 16, 2026
8d35ec7
use platform cache
jordan-evens Sep 17, 2026
00d29f4
split merge into two jobs
jordan-evens Sep 17, 2026
d1ead41
rename variable
jordan-evens Sep 17, 2026
e4446ce
fix variable use
jordan-evens Sep 17, 2026
85c7bb4
rename variable
jordan-evens Sep 17, 2026
b7b09ea
rename variable
jordan-evens Sep 17, 2026
f950c11
remove unused variable
jordan-evens Sep 17, 2026
fcf5dff
rename variable
jordan-evens Sep 17, 2026
2d59cf0
remove unused variable
jordan-evens Sep 17, 2026
d1f24a6
derive registry from path
jordan-evens Sep 17, 2026
3b46318
derive registry from package link
jordan-evens Sep 17, 2026
28ca5b5
fix variable
jordan-evens Sep 17, 2026
6227d0b
fix to use prefix
jordan-evens Sep 17, 2026
a5b7ca5
extract CONTAINER_REGISTRY from package
jordan-evens Sep 17, 2026
fbd3c11
fix run
jordan-evens Sep 17, 2026
150886c
consistent naming
jordan-evens Sep 17, 2026
68d0068
uses: ./.github/workflows/docker-merge-image.yml
jordan-evens Sep 17, 2026
e5a47a5
use --parallel for ctest
jordan-evens Sep 17, 2026
e85cb21
add cache-from: type=registry,ref=${{ env.PACKAGE }}
jordan-evens Sep 17, 2026
c6baa4d
Revert "add cache-from: type=registry,ref=${{ env.PACKAGE }}"
jordan-evens Sep 17, 2026
708d613
remove args: VERSION
jordan-evens Sep 17, 2026
179a55d
fix missing newline in generated version.cpp
jordan-evens Sep 17, 2026
0190cca
use composite action
jordan-evens Sep 17, 2026
50ab451
add missing shell
jordan-evens Sep 17, 2026
599a83c
change cmake-test.yml to not run when only docker workflow changed
jordan-evens Sep 17, 2026
588f291
fix settings env.PLATFORM
jordan-evens Sep 17, 2026
e44ef73
fix typo
jordan-evens Sep 17, 2026
ea3b950
add registry to inputs
jordan-evens Sep 17, 2026
d00295e
pass input registry to merge
jordan-evens Sep 17, 2026
2491c8b
fix matrix.platform
jordan-evens Sep 17, 2026
a7ed05d
determine package once and pass to other steps
jordan-evens Sep 17, 2026
c3fb0ea
make registry required and fix chaining
jordan-evens Sep 17, 2026
8f0f4e9
add show values
jordan-evens Sep 17, 2026
d418a42
remove inputs chaining
jordan-evens Sep 17, 2026
3dcb73a
add suffix for pr
jordan-evens Sep 17, 2026
9ff3508
add inputs to outputs
jordan-evens Sep 17, 2026
7b96179
rename variable to package-name
jordan-evens Sep 17, 2026
cd02f94
fix shell
jordan-evens Sep 17, 2026
047f281
amd64 only for testing
jordan-evens Sep 17, 2026
5533139
assign outputs at job level
jordan-evens Sep 17, 2026
24a4cfe
export output directory from build step
jordan-evens Sep 17, 2026
a20c0e5
use full package url for merge input
jordan-evens Sep 17, 2026
d716380
fix missing output
jordan-evens Sep 17, 2026
44f8ab9
Revert "export output directory from build step"
jordan-evens Sep 17, 2026
c2e2844
add outputs to action
jordan-evens Sep 17, 2026
bd6196a
fix indent
jordan-evens Sep 17, 2026
0833b35
move outputs
jordan-evens Sep 17, 2026
fdb31a6
fix output
jordan-evens Sep 17, 2026
7ffa64d
remove env variables for inputs
jordan-evens Sep 17, 2026
84035b2
remove unused outputs
jordan-evens Sep 17, 2026
8ccc3c3
simplify variables
jordan-evens Sep 17, 2026
11b767a
output directly from step
jordan-evens Sep 17, 2026
dd82a95
add other platforms
jordan-evens Sep 17, 2026
40215d7
multiple caches
jordan-evens Sep 17, 2026
9ecd720
remove slashes from cache ref
jordan-evens Sep 17, 2026
bf6809d
v0.9.19
jordan-evens Sep 17, 2026
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
82 changes: 41 additions & 41 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ ARG BASE_DISTROLESS=gcr.io/distroless/static-debian13
# armv/v5, 386, riscv64, i686
ARG BASE_SLIM=debian:trixie-slim

FROM --platform=linux/amd64 ${BASE_DISTROLESS} AS distroless-amd64

# seems like we can just delete everything and then copy distroless into any platform?
FROM ${BASE_SLIM} AS base-minimal
WORKDIR /appl/firestarr
RUN mkdir -p /appl/firestarr/grid
# HACK: mkdir doesn't exist when copied into scratch but COPY should work
WORKDIR /
RUN rm -rf $(ls -1 / | grep -vE "appl|dev|etc|proc|sys")
COPY --from=distroless-amd64 / /

# make a layer with scratch to clear out old layers
FROM ${BASE_SLIM} AS base-cleaned
WORKDIR /appl/firestarr
RUN mkdir -p /appl/firestarr/grid
RUN apt-get clean \
&& rm -rf \
/tmp/* \
/usr/share/doc/* \
/var/cache/* \
/var/lib/apt/lists/* \
/var/lib/dpkg/* \
/var/tmp/*

# basic image to start from
FROM debian:trixie-slim AS gcc-cmake
ARG TARGETARCH
Expand Down Expand Up @@ -41,16 +65,17 @@ RUN git clone -v https://github.com/microsoft/vcpkg.git \
# install packages so they stay if nothing changes with vcpkg*.json
FROM vcpkg-bootstrap AS vcpkg-installed
WORKDIR /appl/firestarr
COPY ./vcpkg.json .
RUN vcpkg/vcpkg install
RUN --mount=type=bind,source=./vcpkg.json,target=./vcpkg.json \
vcpkg/vcpkg install

# build and test
FROM vcpkg-installed AS firestarr-build
WORKDIR /appl/firestarr
# HACK: copy .env here since cmake needs to write to it in github workflow
COPY .env ./.env
# NOTE: .env needs to be rw here since cmake needs to write to it in github workflow
# mount instead of copy to minimize layers
RUN --mount=type=bind,source=./cmake,target=./cmake \
RUN --mount=type=bind,source=./vcpkg.json,target=./vcpkg.json \
--mount=type=bind,rw=true,source=./.env,target=./.env \
--mount=type=bind,source=./cmake,target=./cmake \
--mount=type=bind,source=./CMakeLists.txt,target=./CMakeLists.txt \
--mount=type=bind,source=./CMakePresets.json,target=./CMakePresets.json \
--mount=type=bind,source=./.clang-format,target=./.clang-format \
Expand All @@ -66,49 +91,24 @@ RUN --mount=type=bind,source=./cmake,target=./cmake \
--mount=type=bind,source=./LICENSE,target=./LICENSE \
cmake --preset Release \
&& cmake --build --parallel --preset Release \
&& ctest --preset Release

FROM --platform=linux/amd64 ${BASE_DISTROLESS} AS distroless-amd64

# seems like we can just delete everything and then copy distroless into any platform?
FROM ${BASE_SLIM} AS firestarr-base-minimal
# HACK: mkdir doesn't exist when copied into scratch but COPY should work
RUN mkdir -p /appl/firestarr/grid
WORKDIR /
RUN rm -rf $(ls -1 / | grep -vE "appl|dev|etc|proc|sys")
COPY --from=distroless-amd64 / /
&& ctest --parallel --preset Release

# make a layer with scratch to clear out old layers
FROM scratch AS firestarr-minimal
COPY --from=firestarr-base-minimal / /
COPY --from=base-minimal / /
WORKDIR /appl/firestarr
COPY ./fuel.lut /appl/firestarr/
COPY ./settings.ini /appl/firestarr/
COPY --from=firestarr-build /appl/firestarr/firestarr /appl/firestarr/
COPY --from=firestarr-build /appl/firestarr/proj.db /appl/firestarr/proj.db
COPY --from=firestarr-build /appl/firestarr/firestarr .
COPY --from=firestarr-build /appl/firestarr/proj.db ./proj.db
COPY ./fuel.lut .
COPY ./settings.ini .
ENTRYPOINT [ "/appl/firestarr/firestarr" ]

# make a layer with scratch to clear out old layers
FROM ${BASE_SLIM} AS base-cleaned
RUN apt-get clean \
&& rm -rf \
/tmp/* \
/usr/share/doc/* \
/var/cache/* \
/var/lib/apt/lists/* \
/var/lib/dpkg/* \
/var/tmp/*

# use --from=firestarr-minimal to create a dependency so cache hopefully includes both
FROM base-cleaned AS firestarr-base-cleaned
COPY ./fuel.lut /appl/firestarr/
COPY ./settings.ini /appl/firestarr/
COPY --from=firestarr-minimal /appl/firestarr/firestarr /appl/firestarr/
COPY --from=firestarr-minimal /appl/firestarr/proj.db /appl/firestarr/proj.db

# derive final image from base so updates to binary are small layers
FROM scratch AS firestarr
COPY --from=firestarr-base-cleaned / /
RUN mkdir -p /appl/firestarr/grid
COPY --from=base-cleaned / /
WORKDIR /appl/firestarr
COPY --from=firestarr-minimal /appl/firestarr/firestarr .
COPY --from=firestarr-minimal /appl/firestarr/proj.db ./proj.db
COPY ./fuel.lut .
COPY ./settings.ini .
ENTRYPOINT [ "/appl/firestarr/firestarr" ]
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.9.16
VERSION=0.9.19
87 changes: 87 additions & 0 deletions .github/actions/docker-build-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# requires docker setup elsewhere
name: docker-build-image
description: 'Build docker image for specific platform'

inputs:
target:
required: true
type: string
package-name:
required: true
type: string
platform:
required: true
type: string
registry:
required: true
type: string

env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1

outputs:
package:
description: "Container package"
value: ${{ steps.output.outputs.package }}

runs:
using: "composite"
steps:
- name: Prepare environment
shell: bash
run: |
PLATFORM=${{ inputs.platform }}
REPO=${{ inputs.registry }}/${GITHUB_REPOSITORY@L}
REF_NAME=${{ github.ref_name }}
echo "PLATFORM_PAIR=${PLATFORM//\//}" >> $GITHUB_ENV
echo "CACHE_REF=${REF_NAME//\//}" >> $GITHUB_ENV
echo "PACKAGE=${REPO}/${{ inputs.package-name }}" >> $GITHUB_ENV
echo "REGISTRY_CACHE=${REPO}/cache" >> $GITHUB_ENV

- name: ${{ inputs.target }} - Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.PACKAGE }}

- name: ${{ inputs.target }} - Build and push by digest
id: build
uses: docker/build-push-action@v7
with:
context: .
file: .docker/Dockerfile
target: ${{ inputs.target }}
platforms: linux/${{ inputs.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.PACKAGE }}
push: ${{ github.event_name != 'pull_request' }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
cache-from: |
type=registry,ref=${{ env.PACKAGE }}
type=registry,ref=${{ env.REGISTRY_CACHE }}:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_REF }}
type=registry,ref=${{ env.REGISTRY_CACHE }}:${{ env.PLATFORM_PAIR }}
type=registry,ref=${{ env.REGISTRY_CACHE }}
cache-to: |
type=registry,mode=max,ref=${{ env.REGISTRY_CACHE }}:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_REF }}
type=registry,mode=max,ref=${{ env.REGISTRY_CACHE }}:${{ env.PLATFORM_PAIR }}

- name: ${{ inputs.target }} - Export digest
shell: bash
run: |
mkdir -p ${{ runner.temp }}/digests-${{ inputs.target }}
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests-${{ inputs.target }}/${digest#sha256:}"

- name: ${{ inputs.target }} - Upload digest
uses: actions/upload-artifact@v7
with:
name: digests-${{ inputs.target }}-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests-${{ inputs.target }}/*
if-no-files-found: error
retention-days: 1

- name: Set outputs
id: output
shell: bash
run: |
echo "package=${{ env.PACKAGE }}" >> $GITHUB_OUTPUT
161 changes: 0 additions & 161 deletions .github/workflows/build-docker-image.yml

This file was deleted.

Loading
Loading