forked from flyteorg/flyteadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheduler.Dockerfile
39 lines (27 loc) · 1.29 KB
/
scheduler.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
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
FROM golang:1.18-alpine3.15 as builder
RUN apk add git openssh-client make curl
# COPY only the go mod files for efficient caching
COPY go.mod go.sum /go/src/github.com/flyteorg/flyteadmin/
WORKDIR /go/src/github.com/flyteorg/flyteadmin
# Pull dependencies
RUN go mod download
# COPY the rest of the source code
COPY . /go/src/github.com/flyteorg/flyteadmin/
# This 'linux_compile_scheduler' target should compile binaries to the /artifacts directory
# The main entrypoint should be compiled to /artifacts/flytescheduler
RUN make linux_compile_scheduler
# update the PATH to include the /artifacts directory
ENV PATH="/artifacts:${PATH}"
# This will eventually move to centurylink/ca-certs:latest for minimum possible image size
FROM alpine:3.15
LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteadmin
COPY --from=builder /artifacts /bin
# Ensure the latest CA certs are present to authenticate SSL connections.
RUN apk --update add ca-certificates
RUN addgroup -S flyte && adduser -S flyte -G flyte
USER flyte
CMD ["flytescheduler"]