Skip to content

Commit 501fdc4

Browse files
committed
refactor: optimize gh-cli image - single RUN layer
1 parent 036eed0 commit 501fdc4

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

gh-cli/Containerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ FROM alpine:3.21
44
LABEL description="Minimal Alpine image with GitHub CLI for automation tasks"
55
LABEL org.opencontainers.image.source="https://github.com/makeitworkcloud/images"
66

7+
# Single layer: install packages, create user, clean up
78
# hadolint ignore=DL3018
8-
RUN apk add --no-cache \
9-
github-cli \
10-
bash \
11-
&& rm -rf /var/cache/apk/*
9+
RUN apk add --no-cache github-cli bash \
10+
&& adduser -D -u 1000 gh \
11+
&& rm -rf /var/cache/apk/* /tmp/* /root/.cache
1212

13-
# Run as non-root by default
14-
RUN adduser -D -u 1000 gh
1513
USER gh
1614
WORKDIR /home/gh
1715

0 commit comments

Comments
 (0)