mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 21:33:22 +01:00
Merge pull request #1314 from crazy-max/fix-vendor
dockerfile: fix vendor
This commit is contained in:
@@ -24,12 +24,7 @@ RUN --mount=target=. <<EOT
|
|||||||
echo "$version" | tee /tmp/.version
|
echo "$version" | tee /tmp/.version
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM base AS vendored
|
FROM base AS test
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
||||||
go mod download
|
|
||||||
|
|
||||||
FROM vendored AS test
|
|
||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
RUN apk add --no-cache gcc linux-headers musl-dev
|
RUN apk add --no-cache gcc linux-headers musl-dev
|
||||||
RUN --mount=type=bind,target=. \
|
RUN --mount=type=bind,target=. \
|
||||||
@@ -43,7 +38,7 @@ EOT
|
|||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage.txt /coverage.txt
|
COPY --from=test /tmp/coverage.txt /coverage.txt
|
||||||
|
|
||||||
FROM vendored AS build
|
FROM base AS build
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
RUN --mount=type=bind,target=. \
|
RUN --mount=type=bind,target=. \
|
||||||
--mount=type=bind,from=version,source=/tmp/.version,target=/tmp/.version \
|
--mount=type=bind,from=version,source=/tmp/.version,target=/tmp/.version \
|
||||||
|
|||||||
Reference in New Issue
Block a user