mirror of https://github.com/chaos-mesh/chaosd.git
34 lines
683 B
Docker
34 lines
683 B
Docker
# syntax=docker/dockerfile:experimental
|
|
|
|
FROM pingcap/chaos-build-base AS go_build
|
|
|
|
RUN curl https://dl.google.com/go/go1.14.6.linux-amd64.tar.gz | tar -xz -C /usr/local
|
|
ENV PATH "/usr/local/go/bin:${PATH}"
|
|
ENV GO111MODULE=on
|
|
|
|
ARG HTTPS_PROXY
|
|
ARG HTTP_PROXY
|
|
|
|
RUN if [[ -n "$HTTP_PROXY" ]]; then yarn config set proxy $HTTP_PROXY; fi
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . /src
|
|
|
|
ARG UI
|
|
ARG SWAGGER
|
|
ARG LDFLAGS
|
|
|
|
RUN --mount=type=cache,target=/root/go/pkg \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
--mount=type=cache,target=/src/ui/node_modules \
|
|
IMG_LDFLAGS=$LDFLAGS make binary
|
|
|
|
FROM alpine:3.12
|
|
|
|
RUN apk add --no-cache curl tar
|
|
|
|
WORKDIR /bin
|
|
|
|
COPY --from=go_build /src/bin /bin
|