Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Using a scratch image to reduce image size and attack surface
Browse files Browse the repository at this point in the history
Signed-off-by: Anand Francis Joseph <[email protected]>
  • Loading branch information
anandf committed Oct 12, 2023
1 parent 553036d commit 8406000
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile.serve
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ WORKDIR /tmp/kam
COPY . .
RUN make all_platforms && \
make checksum && \
go build -o /tmp/kamserve tools/kam-serve/main.go && \
CGO_ENABLED=0 go build -o /tmp/kamserve tools/kam-serve/main.go && \
mkdir -p /tmp/workdir/kam-root/kam && \
cp config/index.html /tmp/workdir/kam-root/index.html && \
mv /tmp/kam/dist/* /tmp/workdir/kam-root/kam/


FROM ubuntu
FROM scratch

# Add application sources
COPY --from=builder /tmp/workdir/ /tmp/
COPY --from=builder /tmp/kamserve /

EXPOSE 9000

# The run script uses standard ways to run the application
ENTRYPOINT ["/kamserve"]
ENTRYPOINT ["./kamserve"]

0 comments on commit 8406000

Please sign in to comment.