github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/dockerfiles/Dockerfile.dev (about)

     1  # syntax=docker/dockerfile:1
     2  
     3  ARG GO_VERSION=1.19.7
     4  ARG ALPINE_VERSION=3.16
     5  
     6  FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golang
     7  ENV  CGO_ENABLED=0
     8  
     9  FROM golang AS esc
    10  ARG ESC_VERSION=v0.2.0
    11  RUN --mount=type=cache,target=/root/.cache/go-build \
    12      --mount=type=cache,target=/go/pkg/mod \
    13      --mount=type=tmpfs,target=/go/src/ \
    14      GO111MODULE=on go install github.com/mjibson/esc@${ESC_VERSION}
    15  
    16  FROM golang AS gotestsum
    17  ARG GOTESTSUM_VERSION=v1.8.2
    18  RUN --mount=type=cache,target=/root/.cache/go-build \
    19      --mount=type=cache,target=/go/pkg/mod \
    20      --mount=type=tmpfs,target=/go/src/ \
    21      GO111MODULE=on go install gotest.tools/gotestsum@${GOTESTSUM_VERSION}
    22  
    23  FROM golang AS vndr
    24  ARG VNDR_VERSION=v0.1.2
    25  RUN --mount=type=cache,target=/root/.cache/go-build \
    26      --mount=type=cache,target=/go/pkg/mod \
    27      --mount=type=tmpfs,target=/go/src/ \
    28      GO111MODULE=on go install github.com/LK4D4/vndr@${VNDR_VERSION}
    29  
    30  FROM golang AS dev
    31  RUN  apk add --no-cache \
    32      bash \
    33      build-base \
    34      ca-certificates \
    35      coreutils \
    36      curl \
    37      git
    38  
    39  CMD bash
    40  ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
    41  ENV PATH=$PATH:/go/src/github.com/docker/cli/build
    42  
    43  COPY --from=esc       /go/bin/* /go/bin/
    44  COPY --from=vndr      /go/bin/* /go/bin/
    45  COPY --from=gotestsum /go/bin/* /go/bin/
    46  
    47  WORKDIR /go/src/github.com/docker/cli
    48  ENV GO111MODULE=auto
    49  COPY . .