Skip to content

Commit

Permalink
Introduce arch-dependant distroless images
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Sep 25, 2024
1 parent cad9c60 commit 77ef5b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,23 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM gcr.io/distroless/static-debian12
FROM gcr.io/distroless/base-debian12 as distroless-base

FROM distroless-base AS distroless-amd64
ENV LIB_DIR_PREFIX x86_64

FROM distroless-base AS distroless-arm64
ENV LIB_DIR_PREFIX aarch64

FROM distroless-$TARGETARCH AS output-image

WORKDIR /

COPY --from=builder /workspace/fedhcp .
COPY --from=installer /sbin/setcap /sbin/setcap
COPY --from=installer /lib/x86_64-linux-gnu/libcap.so.2 /lib/x86_64-linux-gnu/libcap.so.2
COPY --from=installer /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=installer /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
COPY --from=installer /lib/${LIB_DIR_PREFIX}-linux-gnu/libcap.so.2 /lib/${LIB_DIR_PREFIX}-linux-gnu/libcap.so.2
COPY --from=installer /lib/${LIB_DIR_PREFIX}-linux-gnu/libc.so.6 /lib/${LIB_DIR_PREFIX}-linux-gnu/libc.so.6
COPY --from=installer /lib/${LIB_DIR_PREFIX}-linux-gnu/ld-linux-x86-64.so.2 /lib/${LIB_DIR_PREFIX}-linux-gnu/ld-linux-x86-64.so.2
COPY --from=installer /bin/sh /bin/sh

RUN /sbin/setcap 'cap_net_bind_service,cap_net_raw=+ep' /fedhcp
Expand Down

0 comments on commit 77ef5b2

Please sign in to comment.