Skip to content

Commit fdb0a0b

Browse files
committed
Use Debian Slim image in GitHub action
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent c7e7b61 commit fdb0a0b

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed
Lines changed: 16 additions & 6 deletions
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" ]

0 commit comments

Comments
 (0)