Skip to content

Commit 221d099

Browse files
authored
Merge pull request #391 from fluxcd/libgit2-unstable
2 parents 850157c + 2c63246 commit 221d099

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

.github/actions/run-tests/Dockerfile

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
FROM golang:1.16-alpine
1+
FROM golang:1.16-buster as builder
22

3-
# Add any build or testing essential system packages
4-
RUN apk add --no-cache build-base git pkgconf
5-
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community libgit2-dev~=1.1
3+
# Up-to-date libgit2 dependencies are only available in
4+
# unstable, as libssh2 in testing/bullseye has been linked
5+
# against gcrypt which causes issues with PKCS* formats.
6+
# Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668271
7+
RUN echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list \
8+
&& echo "deb-src http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
9+
RUN set -eux; \
10+
apt-get update \
11+
&& apt-get install -y libgit2-dev/unstable \
12+
&& apt-get clean \
13+
&& apt-get autoremove --purge -y \
14+
&& rm -rf /var/lib/apt/lists/*
615

716
# Use the GitHub Actions uid:gid combination for proper fs permissions
8-
RUN addgroup -g 116 -S test && adduser -u 1001 -S -g test test
17+
RUN groupadd -g 116 test && \
18+
useradd -u 1001 --gid test --shell /bin/sh --create-home test
919

1020
# Run as test user
1121
USER test
1222

13-
ENTRYPOINT ["/bin/sh", "-c"]
23+
ENTRYPOINT [ "/bin/sh", "-c" ]

Dockerfile

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
FROM golang:1.16-buster as builder
22

33
# Up-to-date libgit2 dependencies are only available in
4-
# >=bullseye (testing).
5-
RUN echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list \
6-
&& echo "deb-src http://deb.debian.org/debian testing main" >> /etc/apt/sources.list
4+
# unstable, as libssh2 in testing/bullseye has been linked
5+
# against gcrypt which causes issues with PKCS* formats.
6+
# Explicitly listing all build dependencies is required because
7+
# they can only be automagically found for AMD64 builds.
8+
# Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668271
9+
RUN echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list \
10+
&& echo "deb-src http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
711
RUN set -eux; \
812
apt-get update \
9-
&& apt-get install -y libgit2-dev/testing zlib1g-dev/testing libssh2-1-dev/testing libpcre3-dev/testing \
13+
&& apt-get install -y \
14+
libgit2-dev/unstable \
15+
zlib1g-dev/unstable \
16+
libssh2-1-dev/unstable \
17+
libpcre3-dev/unstable \
1018
&& apt-get clean \
1119
&& apt-get autoremove --purge -y \
1220
&& rm -rf /var/lib/apt/lists/*
@@ -38,12 +46,16 @@ FROM debian:buster-slim as controller
3846
LABEL org.opencontainers.image.source="https://github.com/fluxcd/source-controller"
3947

4048
# Up-to-date libgit2 dependencies are only available in
41-
# >=bullseye (testing).
42-
RUN echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list \
43-
&& echo "deb-src http://deb.debian.org/debian testing main" >> /etc/apt/sources.list
49+
# unstable, as libssh2 in testing/bullseye has been linked
50+
# against gcrypt which causes issues with PKCS* formats.
51+
# Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668271
52+
RUN echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list \
53+
&& echo "deb-src http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
4454
RUN set -eux; \
4555
apt-get update \
46-
&& apt-get install -y ca-certificates libgit2-1.1 \
56+
&& apt-get install -y \
57+
ca-certificates \
58+
libgit2-1.1 \
4759
&& apt-get clean \
4860
&& apt-get autoremove --purge -y \
4961
&& rm -rf /var/lib/apt/lists/*
@@ -54,4 +66,4 @@ RUN groupadd controller && \
5466
useradd --gid controller --shell /bin/sh --create-home controller
5567

5668
USER controller
57-
ENTRYPOINT ["source-controller"]
69+
ENTRYPOINT [ "source-controller" ]

config/testdata/git/large-repo.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
interval: 10m
88
url: https://github.com/hashgraph/hedera-mirror-node.git
99
ref:
10-
branch: master
10+
branch: main
1111
ignore: |
1212
/*
1313
!/charts
@@ -21,7 +21,7 @@ spec:
2121
interval: 10m
2222
url: https://github.com/hashgraph/hedera-mirror-node.git
2323
ref:
24-
branch: master
24+
branch: main
2525
ignore: |
2626
/*
2727
!/charts

0 commit comments

Comments
 (0)