forked from treeverse/lakeFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (39 loc) · 1.15 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
FROM golang:1.16.2-alpine AS build
ARG VERSION=dev
WORKDIR /build
# Packages required to build
RUN apk add --no-cache build-base
# 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/pkg/version.Version=${VERSION}" -o lakefs ./cmd/lakefs
RUN go build -ldflags "-X github.com/treeverse/lakefs/pkg/version.Version=${VERSION}" -o lakectl ./cmd/lakectl
# 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"]
# 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 ./scripts/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"]