Skip to content

Commit

Permalink
Revert "chore: Revise scratch image"
Browse files Browse the repository at this point in the history
This reverts commit 19ce7f1.
  • Loading branch information
aeneasr authored Jan 11, 2025
1 parent 1614e23 commit c9f4896
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions .docker/Dockerfile-scratch
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
FROM alpine:3.20 AS base-files
FROM alpine:3.20

RUN <<HEREDOC
apk upgrade --no-cache
RUN apk upgrade --no-cache && \
apk add --no-cache --upgrade ca-certificates

# Add a user/group for Ory with a stable UID + GID:
addgroup --system --gid 500 ory
adduser --system --uid 500 \
--gecos "Ory User" \
--home /home/ory \
--ingroup ory \
--shell /sbin/nologin \
ory
RUN addgroup -S ory; \
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin;

# Create the sqlite directory with ownership to that user and group:
install --owner ory --group ory --directory /var/lib/sqlite
HEREDOC
RUN mkdir -p /var/lib/sqlite && \
chown -R ory:ory /var/lib/sqlite

FROM scratch
COPY --from=base-files /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=base-files /etc/nsswitch.conf /etc/nsswitch.conf
# NOTE: /etc/group and /etc/shadow were not copied over, only user lookup is valid for `USER`:
COPY --from=base-files /etc/passwd /etc/passwd
COPY --from=base-files /var/lib/sqlite /var/lib/sqlite

COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /etc/nsswitch.conf /etc/nsswitch.conf
COPY --from=0 /etc/passwd /etc/passwd
COPY --from=0 /var/lib/sqlite /var/lib/sqlite

COPY hydra /usr/bin/hydra

Expand Down

0 comments on commit c9f4896

Please sign in to comment.