1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/tonistiigi/fsutil/Dockerfile
Sebastiaan van Stijn e5d28115ee
vendor: regenerate
- all changes here are attributed to difference in behaviour between,
  namely:
  - resolution of secondary test dependencies
  - prunning of non-Go files

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-01-18 15:46:04 +01:00

29 lines
686 B
Docker

#syntax=docker/dockerfile:1.2
ARG GO_VERSION=1.16
FROM --platform=amd64 tonistiigi/xx:golang AS goxx
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base
RUN apk add --no-cache gcc musl-dev
COPY --from=goxx / /
WORKDIR /src
FROM base AS build
ARG TARGETPLATFORM
RUN --mount=target=. \
--mount=target=/root/.cache,type=cache \
go build ./...
FROM base AS test
RUN --mount=target=. \
--mount=target=/root/.cache,type=cache \
go test -test.v ./...
FROM base AS test-noroot
RUN mkdir /go/pkg && chmod 0777 /go/pkg
USER 1000:1000
RUN --mount=target=. \
--mount=target=/tmp/.cache,type=cache \
GOCACHE=/tmp/gocache go test -test.v ./...
FROM build