Skip to content

Commit

Permalink
VEC-450: use shell entrypoint with asvec as command to allow easier u…
Browse files Browse the repository at this point in the history
…sage in k8s
  • Loading branch information
arrowplum committed Dec 6, 2024
1 parent 43b7eac commit 0edc92a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Build Stage
# ----------------------
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS builder

WORKDIR /app

# Build arguments for cross-compilation
Expand All @@ -22,15 +21,22 @@
# Build the application
RUN \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app/target/asvec .
## desire is to use distroless as the final image with sh binary but use alpine for now
# # ----------------------
# # BusyBox Stage
# # ----------------------

# FROM --platform=$TARGETPLATFORM busybox AS busybox

# ----------------------
# Final Stage
# ----------------------
FROM --platform=$TARGETPLATFORM gcr.io/distroless/static-debian12
# ----------------------
# Final Stage
# ----------------------
FROM --platform=$TARGETPLATFORM alpine:latest

# Copy the binary from the builder stage
COPY --from=builder /app/target/asvec /usr/local/bin/asvec

# Set the entrypoint to the asvec binary
ENTRYPOINT ["/usr/local/bin/asvec"]
# Set the entrypoint to the shell
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["/usr/local/bin/asvec"]

0 comments on commit 0edc92a

Please sign in to comment.