Skip to content

Commit

Permalink
chore: Update Dockerfile to use golang 1.22.4 and optimize build proc…
Browse files Browse the repository at this point in the history
…ess via distroless image
  • Loading branch information
Gyarbij committed Jun 22, 2024
1 parent 776ace3 commit ea15fb9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# Build step
FROM golang:1.22.4 AS builder
RUN mkdir -p /build
WORKDIR /build
COPY . .
RUN go build

# Final step
FROM debian:bookworm-slim
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates && \
rm -rf /var/lib/apt/lists/* \
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o azure-oai-proxy .

FROM gcr.io/distroless/base-debian12
COPY --from=builder /build/azure-oai-proxy /
EXPOSE 11437
WORKDIR /app
COPY --from=builder /build/azure-oai-proxy /app/azure-oai-proxy
ENTRYPOINT ["/app/azure-oai-proxy"]
ENTRYPOINT ["/azure-oai-proxy"]

0 comments on commit ea15fb9

Please sign in to comment.