Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoupert authored Feb 1, 2024
1 parent 91e3890 commit 822c2ab
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,20 @@ COPY ./ .
# We no longer need to use the x86_64-unknown-linux-musl target
RUN cargo build --release


####################################################################################################
## Copy last version of libc library for amd64 and arm64 archs
####################################################################################################
FROM --platform=amd64 gcr.io/distroless/cc AS final-amd64
COPY --from=builder /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6

FROM --platform=arm64 gcr.io/distroless/cc AS final-arm64
COPY --from=builder /lib/aarch64-linux-gnu/libc.so.6 /lib/aarch64-linux-gnu/libc.so.6

####################################################################################################
## Final image
####################################################################################################
FROM gcr.io/distroless/cc
FROM final-${TARGETARCH}

# Import from builder.
COPY --from=builder /etc/passwd /etc/passwd
Expand All @@ -37,7 +47,6 @@ COPY --from=builder /etc/group /etc/group
WORKDIR /isotope

# Copy our build
COPY --from=builder /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=builder /isotope/target/release/isotope ./

# Use an unprivileged user.
Expand Down

0 comments on commit 822c2ab

Please sign in to comment.