fix: Dockerfile

This commit is contained in:
yusing 2025-04-26 05:51:37 +08:00
parent 01179adfa8
commit 90ba355d16

View file

@ -6,14 +6,6 @@ HEALTHCHECK NONE
# trunk-ignore(hadolint/DL3018) # trunk-ignore(hadolint/DL3018)
RUN apk add --no-cache tzdata make libcap-setcap RUN apk add --no-cache tzdata make libcap-setcap
WORKDIR /src
# Only copy go.mod and go.sum initially for better caching
COPY go.mod go.sum /src/
ENV GOPATH=/root/go
RUN go mod download -x
# Stage 2: builder # Stage 2: builder
FROM deps AS builder FROM deps AS builder
@ -25,6 +17,12 @@ COPY internal ./internal
COPY pkg ./pkg COPY pkg ./pkg
COPY agent ./agent COPY agent ./agent
# Only copy go.mod and go.sum initially for better caching
COPY go.mod go.sum /src/
ENV GOPATH=/root/go
RUN go mod download -x
ARG VERSION ARG VERSION
ENV VERSION=${VERSION} ENV VERSION=${VERSION}