-
Notifications
You must be signed in to change notification settings - Fork 109
/
Dockerfile
60 lines (46 loc) · 2.79 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ARG ALPINE_VERSION=3.18
FROM golang:alpine${ALPINE_VERSION} AS base
RUN apk add --update docker docker-compose docker-cli-compose docker-cli-buildx openrc containerd git bash make wget vim curl openssl util-linux
ARG K6_VERSION XK6_VERSION XK6_SQL_VERSION XK6_SQL_POSTGRES_VERSION
RUN go install go.k6.io/xk6/cmd/xk6@v${XK6_VERSION}
RUN xk6 build v${K6_VERSION} \
--with github.com/grafana/xk6-sql@v${XK6_SQL_VERSION} \
--with github.com/grafana/xk6-sql-driver-postgres@v${XK6_SQL_POSTGRES_VERSION} \
--output /usr/bin/k6
# Install Helm
RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# Install Kubectl
ARG TARGETARCH
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin
FROM alpine:${ALPINE_VERSION} AS latest
COPY --from=base /etc /etc
COPY --from=base /usr /usr
COPY --from=base /lib /lib
COPY --from=docker:dind /usr/local/bin /usr/local/bin
ARG CACHE_DATE
RUN echo "Instill Core latest codebase cloned on ${CACHE_DATE}"
WORKDIR /instill-core
ARG CONTROLLER_MODEL_VERSION
RUN git clone --depth=1 https://github.com/instill-ai/artifact-backend.git
RUN git clone --depth=1 https://github.com/instill-ai/api-gateway.git
RUN git clone --depth=1 https://github.com/instill-ai/mgmt-backend.git
RUN git clone --depth=1 https://github.com/instill-ai/console.git
RUN git clone --depth=1 https://github.com/instill-ai/pipeline-backend.git
RUN git clone --depth=1 https://github.com/instill-ai/model-backend.git
FROM alpine:${ALPINE_VERSION} AS release
COPY --from=base /etc /etc
COPY --from=base /usr /usr
COPY --from=base /lib /lib
COPY --from=docker:dind /usr/local/bin /usr/local/bin
ARG CACHE_DATE
RUN echo "Instill Core release codebase cloned on ${CACHE_DATE}"
WORKDIR /instill-core
ARG API_GATEWAY_VERSION MGMT_BACKEND_VERSION CONSOLE_VERSION PIPELINE_BACKEND_VERSION MODEL_BACKEND_VERSION ARTIFACT_BACKEND_VERSION CONTROLLER_MODEL_VERSION
RUN git clone --depth=1 -b v${API_GATEWAY_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/api-gateway.git
RUN git clone --depth=1 -b v${MGMT_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/mgmt-backend.git
RUN git clone --depth=1 -b v${CONSOLE_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/console.git
RUN git clone --depth=1 -b v${PIPELINE_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/pipeline-backend.git
RUN git clone --depth=1 -b v${MODEL_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/model-backend.git
RUN git clone --depth=1 -b v${ARTIFACT_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/artifact-backend.git