19 lines
597 B
Docker
19 lines
597 B
Docker
FROM golang:1.21 as builder
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
|
|
ARG SKAFFOLD_GO_GCFLAGS
|
|
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o sessions ./cmd/sessions/main.go
|
|
|
|
FROM ubuntu:22.04
|
|
# Define GOTRACEBACK to mark this container as using the Go language runtime
|
|
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
|
|
WORKDIR /root
|
|
ENV GOTRACEBACK=single
|
|
RUN apt update
|
|
RUN apt install -y ca-certificates tzdata
|
|
COPY --from=builder /app/sessions .
|
|
ENTRYPOINT ["./sessions"]
|