Skip to content

Commit a871e0b

Browse files
committed
Update Dockerfile used in tests as well
This ensures the Dockerfile used for testing is making use of the same scratch image to compile `libgit2` as the actual application image. In a future iteration we should restructure our GitHub Action workflows to re-use the application image, saving us an additional Dockerfile and a duplicate build. Inspiration for this (which makes use of a local registry for the duration of the build) can be found at: https://github.com/fluxcd/golang-with-libgit2/blob/main/.github/workflows/build.yaml Signed-off-by: Hidde Beydals <[email protected]>
1 parent 9fd16d8 commit a871e0b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/actions/run-tests/Dockerfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
FROM ghcr.io/fluxcd/golang-with-libgit2:1.16.8-bullseye-libgit2-1.1.1-1 as build
1+
ARG BASE_VARIANT=bullseye
2+
ARG GO_VERSION=1.16.8
3+
ARG XX_VERSION=1.0.0-rc.2
4+
5+
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6+
ARG LIBGIT2_TAG=libgit2-1.1.1
7+
8+
FROM tonistiigi/xx:${XX_VERSION} AS xx
9+
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2
10+
11+
FROM golang:${GO_VERSION}-${BASE_VARIANT} as gostable
12+
13+
# Copy the build utiltiies
14+
COPY --from=xx / /
15+
COPY --from=libgit2 /Makefile /libgit2/
16+
17+
# Install the libgit2 build dependencies
18+
RUN make -C /libgit2 cmake
19+
20+
RUN make -C /libgit2 dependencies
21+
22+
# Compile and install libgit2
23+
RUN FLAGS=$(xx-clang --print-cmake-defines) make -C /libgit2 libgit2
224

325
# Use the GitHub Actions uid:gid combination for proper fs permissions
426
RUN groupadd -g 116 test && \

0 commit comments

Comments
 (0)