forked from treeverse/lakeFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (37 loc) · 1.07 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
FROM golang:1.14.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
# lakectl image
FROM alpine:3.11.5 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"]
# lakefs image
FROM alpine:3.11.5 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"]