forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
88 lines (60 loc) · 2.39 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM golang:1.16.0-alpine3.13 AS go_builder_
# Install dependencies
RUN apk add --no-cache build-base git make
# Create directory to store built artifacts
ARG INSTALL_DIR="/install"
RUN mkdir -p ${INSTALL_DIR}
ARG BUILDKIT_CLI_FOR_KUBECTL_VERSION="v0.1.2"
RUN git clone -b ${BUILDKIT_CLI_FOR_KUBECTL_VERSION} --single-branch --depth 1 https://github.com/vmware-tanzu/buildkit-cli-for-kubectl.git ${GOPATH}/src/github.com/vmware-tanzu/buildkit-cli-for-kubectl \
&& make -C ${GOPATH}/src/github.com/vmware-tanzu/buildkit-cli-for-kubectl ${INSTALL_DIR}/linux/kubectl-build BIN_DIR=${INSTALL_DIR} VERSION=${BUILDKIT_CLI_FOR_KUBECTL_VERSION}
FROM alpine:3.13.2 AS base_
# Install dependencies
RUN apk add --no-cache curl
# Make directory to store artifacts
RUN mkdir -p /flyteorg/bin /flyteorg/share
# Install k3s
ARG K3S_VERSION="v1.20.2%2Bk3s1"
RUN wget -q -O /flyteorg/bin/k3s https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s \
&& chmod +x /flyteorg/bin/k3s
# Install buildkit-cli-for-kubectl
COPY --from=go_builder_ /install/linux/ /flyteorg/bin/
# Install flytectl
RUN curl https://raw.githubusercontent.com/flyteorg/flytectl/master/install.sh | sh
# Copy flyte manifest
COPY deployment/sandbox/flyte_generated.yaml /flyteorg/share/flyte_generated.yaml
# Copy scripts
RUN cp /bin/flytectl /flyteorg/bin/
COPY docker/sandbox/kubectl docker/sandbox/wait-for-flyte.sh /flyteorg/bin/
FROM base_ AS default
# Install dependencies
RUN apk add --no-cache bash git make tini
# Copy entrypoints
COPY docker/sandbox/flyte-entrypoint-default.sh /flyteorg/bin/flyte-entrypoint.sh
COPY docker/sandbox/bashrc /root/.bashrc
# Update PATH variable
ENV PATH "/flyteorg/bin:${PATH}"
# Declare volumes for k3s
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni
VOLUME /var/log
# Expose Flyte ports
EXPOSE 30081 30082 30084
ENTRYPOINT ["tini", "flyte-entrypoint.sh"]
FROM docker:20.10.3-dind AS dind
# Install dependencies
RUN apk add --no-cache bash git make tini
# Copy artifacts from base
COPY --from=base_ /flyteorg/ /flyteorg/
# Copy entrypoints
COPY docker/sandbox/flyte-entrypoint-dind.sh /flyteorg/bin/flyte-entrypoint.sh
# Update PATH variable
ENV PATH "/flyteorg/bin:${PATH}"
# Declare volumes for k3s
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni
VOLUME /var/log
# Expose Flyte ports
EXPOSE 30081 30082 30084
ENTRYPOINT ["tini", "flyte-entrypoint.sh"]