forked from chaos-mesh/chaos-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (23 loc) · 814 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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
RUN curl -L https://github.com/chaos-mesh/toda/releases/download/v0.1.1/toda-linux-amd64.tar.gz | tar -xz
COPY ./scripts /scripts
COPY --from=go_build /src/bin /bin