forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 1.01 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
ARG FLYTECONSOLE_VERSION=latest
FROM ghcr.io/flyteorg/flyteconsole:${FLYTECONSOLE_VERSION} AS flyteconsole
FROM --platform=${BUILDPLATFORM} golang:1.19.1-bullseye AS flytebuilder
ARG TARGETARCH
ENV GOARCH "${TARGETARCH}"
ENV GOOS linux
WORKDIR /flyteorg/build
COPY go.mod go.sum ./
RUN go mod download
COPY cmd cmd
COPY --from=flyteconsole /app/ cmd/single/dist
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/go/pkg/mod \
go build -tags console -v -o dist/flyte cmd/main.go
FROM debian:bullseye-slim
ARG FLYTE_VERSION
ENV FLYTE_VERSION "${FLYTE_VERSION}"
ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV DEBIAN_FRONTEND noninteractive
# Install core packages
RUN apt-get update && apt-get install --no-install-recommends --yes \
ca-certificates \
tini \
&& rm -rf /var/lib/apt/lists/*
# Copy compiled executable into image
COPY --from=flytebuilder /flyteorg/build/dist/flyte /usr/local/bin/
# Set entrypoint
ENTRYPOINT [ "/usr/bin/tini", "-g", "--", "/usr/local/bin/flyte" ]