Skip to content

Commit fcdfeae

Browse files
committed
[GitHub] Fix Docker in Create Release Action (#58)
1 parent 98cb603 commit fcdfeae

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

actions/github/createRelease/Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,22 @@ FROM alpine:latest
2020
# Install ca-certificates for HTTPS requests
2121
RUN apk --no-cache add ca-certificates
2222

23-
WORKDIR /root/
23+
# Create a non-root user
24+
RUN addgroup -g 1001 -S appgroup && \
25+
adduser -u 1001 -S appuser -G appgroup
26+
27+
# Set working directory
28+
WORKDIR /app
2429

2530
# Copy the binary from builder stage
2631
COPY --from=builder /app/main .
2732

33+
# Set ownership and permissions
34+
RUN chown appuser:appgroup /app/main && \
35+
chmod +x /app/main
36+
37+
# Switch to non-root user
38+
USER appuser
39+
2840
# Run the binary
29-
ENTRYPOINT ["./main"]
41+
ENTRYPOINT ["/app/main"]

0 commit comments

Comments
 (0)