2022-08-19 10:50:01 -04:00
|
|
|
# syntax=docker/dockerfile:1
|
2021-07-22 08:48:09 -04:00
|
|
|
|
2023-01-10 18:44:06 -05:00
|
|
|
ARG GO_VERSION=1.18.10
|
2022-12-04 08:01:30 -05:00
|
|
|
ARG ALPINE_VERSION=3.16
|
2019-07-18 05:13:45 -04:00
|
|
|
|
2022-12-04 08:01:30 -05:00
|
|
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golang
|
2020-08-28 07:12:07 -04:00
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
|
|
|
|
FROM golang AS esc
|
|
|
|
ARG ESC_VERSION=v0.2.0
|
2020-08-28 07:20:11 -04:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
|
|
--mount=type=tmpfs,target=/go/src/ \
|
2021-07-15 09:15:38 -04:00
|
|
|
GO111MODULE=on go install github.com/mjibson/esc@${ESC_VERSION}
|
2020-08-28 07:12:07 -04:00
|
|
|
|
|
|
|
FROM golang AS gotestsum
|
2022-11-17 11:10:59 -05:00
|
|
|
ARG GOTESTSUM_VERSION=v1.8.2
|
2020-08-28 07:20:11 -04:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
|
|
--mount=type=tmpfs,target=/go/src/ \
|
2021-07-15 09:15:38 -04:00
|
|
|
GO111MODULE=on go install gotest.tools/gotestsum@${GOTESTSUM_VERSION}
|
2020-08-28 07:12:07 -04:00
|
|
|
|
|
|
|
FROM golang AS vndr
|
2020-10-15 19:32:00 -04:00
|
|
|
ARG VNDR_VERSION=v0.1.2
|
2020-08-28 07:20:11 -04:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
|
|
--mount=type=tmpfs,target=/go/src/ \
|
2021-07-15 09:15:38 -04:00
|
|
|
GO111MODULE=on go install github.com/LK4D4/vndr@${VNDR_VERSION}
|
2020-08-28 07:12:07 -04:00
|
|
|
|
|
|
|
FROM golang AS dev
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
build-base \
|
|
|
|
ca-certificates \
|
|
|
|
coreutils \
|
|
|
|
curl \
|
|
|
|
git
|
|
|
|
|
2020-08-28 07:19:09 -04:00
|
|
|
CMD bash
|
2020-08-28 07:12:07 -04:00
|
|
|
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
|
|
|
|
ENV PATH=$PATH:/go/src/github.com/docker/cli/build
|
|
|
|
|
|
|
|
COPY --from=esc /go/bin/* /go/bin/
|
|
|
|
COPY --from=vndr /go/bin/* /go/bin/
|
|
|
|
COPY --from=gotestsum /go/bin/* /go/bin/
|
|
|
|
|
2017-04-18 19:12:24 -04:00
|
|
|
WORKDIR /go/src/github.com/docker/cli
|
2021-07-15 09:15:38 -04:00
|
|
|
ENV GO111MODULE=auto
|
2020-08-28 07:12:07 -04:00
|
|
|
COPY . .
|