Skip to content

Commit 4fd5796

Browse files
committed
release: apply startup permission self-heal to published image
1 parent 7cb6b03 commit 4fd5796

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/Dockerfile.release

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM alpine:3.21
44
ARG TARGETOS
55
ARG TARGETARCH
66

7-
RUN apk add --no-cache ca-certificates tzdata \
7+
RUN apk add --no-cache ca-certificates tzdata su-exec \
88
&& addgroup -S resin \
99
&& adduser -S -G resin -h /var/lib/resin resin \
1010
&& mkdir -p /var/cache/resin /var/lib/resin /var/log/resin \
@@ -13,9 +13,11 @@ RUN apk add --no-cache ca-certificates tzdata \
1313
# Copy the pre-built binaries from the GitHub Actions host into the image
1414
# Buildx provides TARGETOS (linux) and TARGETARCH (amd64 or arm64)
1515
COPY release-bin/${TARGETOS}/${TARGETARCH}/resin-${TARGETOS}-${TARGETARCH} /usr/local/bin/resin
16+
COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
17+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
1618

17-
USER resin
1819
EXPOSE 2260
1920
VOLUME ["/var/cache/resin", "/var/lib/resin", "/var/log/resin"]
2021

21-
ENTRYPOINT ["/usr/local/bin/resin"]
22+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
23+
CMD ["/usr/local/bin/resin"]

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ RUN CGO_ENABLED=0 go build -trimpath -tags "with_quic with_wireguard with_grpc w
3030
-o /out/resin ./cmd/resin
3131

3232
FROM alpine:3.21
33+
# NOTE: Keep this runtime stage in sync with .github/Dockerfile.release.
34+
# GHCR release images are built from .github/Dockerfile.release, not this file.
3335
RUN apk add --no-cache ca-certificates tzdata su-exec \
3436
&& addgroup -S resin \
3537
&& adduser -S -G resin -h /var/lib/resin resin \

0 commit comments

Comments
 (0)