From cd7fae4425c86c7b05b9a6fd466a51fce32c5bdd Mon Sep 17 00:00:00 2001 From: Alejandro Do Nascimento Mora Date: Mon, 22 Apr 2024 13:53:26 +0200 Subject: [PATCH] Update Dockerfile --- Dockerfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 813b9f6..aadea9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,19 @@ -FROM golang:1.19-alpine3.15 AS build +FROM golang:1.22-alpine3.19 AS base -WORKDIR /stage +WORKDIR /github.com/timescale/csv-importer -COPY . . +COPY ./go.mod go.mod +COPY ./go.sum go.sum +RUN go mod download -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /stage/timescaledb-parallel-copy ./cmd/... +FROM base as builder +COPY ./cmd cmd +COPY ./internal internal -FROM scratch +RUN go build -o /bin/timescaledb-parallel-copy ./cmd/timescaledb-parallel-copy -WORKDIR /data +FROM alpine:3.19 as release -COPY --from=build /stage/timescaledb-parallel-copy /usr/bin/ +COPY --from=builder /bin/timescaledb-parallel-copy /bin/timescaledb-parallel-copy ENTRYPOINT [ "timescaledb-parallel-copy" ] -