Skip to content

Commit

Permalink
dockerfile: fix vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Dec 20, 2024
1 parent 194fd5a commit b8a93b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ RUN --mount=target=. <<EOT
echo "$version" | tee /tmp/.version
EOT

FROM base AS vendored
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

FROM vendored AS test
FROM base AS test
ENV CGO_ENABLED=1
RUN apk add --no-cache gcc linux-headers musl-dev
RUN --mount=type=bind,target=. \
Expand All @@ -43,7 +38,7 @@ EOT
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage.txt /coverage.txt

FROM vendored AS build
FROM base AS build
ARG TARGETPLATFORM
RUN --mount=type=bind,target=. \
--mount=type=bind,from=version,source=/tmp/.version,target=/tmp/.version \
Expand Down

0 comments on commit b8a93b1

Please sign in to comment.