From 7945f9518091558884691828ad90edbe964c7db6 Mon Sep 17 00:00:00 2001 From: Philip Laine Date: Wed, 9 Dec 2020 23:32:23 +0100 Subject: [PATCH 1/2] Install musl edge version Signed-off-by: Philip Laine --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 93c8c112..dd437db0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM golang:1.15-alpine as builder RUN apk add gcc pkgconfig libc-dev RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1.0 +RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main musl=1.2.2_pre5-r0 WORKDIR /workspace From 3feda811096e605627100e066d52a61acf8cd914 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 9 Dec 2020 23:52:20 +0100 Subject: [PATCH 2/2] Tweak `musl` and `libgit2{-dev}` dependencies * Use semver tidles to deal with future patch releases * Install just `libgit2` in runtime container * Add TODO / explanation for `musl` `1.2.x` dependency Signed-off-by: Hidde Beydals --- .github/actions/run-tests/Dockerfile | 2 +- Dockerfile | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/run-tests/Dockerfile b/.github/actions/run-tests/Dockerfile index e5f1c131..c849027d 100644 --- a/.github/actions/run-tests/Dockerfile +++ b/.github/actions/run-tests/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.15-alpine # Add any build or testing essential system packages RUN apk add --no-cache build-base git pkgconf -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1.0 +RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1 # Use the GitHub Actions uid:gid combination for proper fs permissions RUN addgroup -g 116 -S test && adduser -u 1001 -S -g test test diff --git a/Dockerfile b/Dockerfile index dd437db0..ce8b87c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,11 @@ FROM golang:1.15-alpine as builder RUN apk add gcc pkgconfig libc-dev -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1.0 -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main musl=1.2.2_pre5-r0 +RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1 +# TODO: replace with non-edge musl 1.2.x when made available +# musl 1.2.x is a strict requirement of libgit2 due to time_t changes +# ref: https://musl.libc.org/time64.html +RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main musl~=1.2 WORKDIR /workspace @@ -32,7 +35,7 @@ FROM alpine:3.12 LABEL org.opencontainers.image.source="https://github.com/fluxcd/source-controller" RUN apk add --no-cache ca-certificates tini -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1.0 +RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2~=1.1 COPY --from=builder /workspace/source-controller /usr/local/bin/