forked from treeverse/lakeFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (44 loc) · 1.36 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
FROM golang:1.15.2-alpine AS build
ARG VERSION=dev
WORKDIR /build
# Copy project deps first since they don't change often
COPY go.mod go.sum ./
RUN go mod download
# Copy project
COPY . ./
# Build a binaries
RUN go build -ldflags "-X github.com/treeverse/lakefs/config.Version=${VERSION}" -o lakefs ./cmd/lakefs
RUN go build -ldflags "-X github.com/treeverse/lakefs/config.Version=${VERSION}" -o lakectl ./cmd/lakectl
RUN go build -ldflags "-X github.com/treeverse/lakefs/config.Version=${VERSION}" -o benchmark-executor ./benchmarks
# lakectl image
FROM alpine:3.12.0 AS lakectl
WORKDIR /app
ENV PATH /app:$PATH
COPY --from=build /build/lakectl ./
RUN addgroup -S lakefs && adduser -S lakefs -G lakefs
USER lakefs
WORKDIR /home/lakefs
ENTRYPOINT ["/app/lakectl"]
# benchmark-executor image
FROM alpine:3.11.5 AS benchmark-executor
WORKDIR /app
ENV PATH /app:$PATH
COPY --from=build /build/benchmark-executor ./
ENTRYPOINT ["/app/benchmark-executor"]
# lakefs image
FROM alpine:3.12.0 AS lakefs
# Be Docker compose friendly (i.e. support wait-for)
RUN apk add netcat-openbsd
WORKDIR /app
COPY ./wait-for ./
ENV PATH /app:$PATH
COPY --from=build /build/lakefs /build/lakectl ./
EXPOSE 8000/tcp
# Setup user
RUN addgroup -S lakefs && adduser -S lakefs -G lakefs
USER lakefs
WORKDIR /home/lakefs
# Configuration location
VOLUME /etc/lakefs.yaml
ENTRYPOINT ["/app/lakefs"]
CMD ["run"]