-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 1.02 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
FROM golang:1.23.2-alpine3.19 as builder
ARG tags
# Set destination for COPY
WORKDIR /usr/src/app
RUN apk add --no-cache make
# Set up build dependencies
RUN go install \
github.com/bufbuild/buf/cmd/[email protected]
RUN go install google.golang.org/protobuf/cmd/[email protected]
RUN go install google.golang.org/grpc/cmd/[email protected]
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GO_BUILD_TAGS=${tags} make build
FROM alpine:3.20
LABEL org.opencontainers.image.source="https://github.com/alexandreLamarre/dlock"
LABEL org.opencontainers.image.description="Reliable & scalable distributed locking, scheduling and synchronization"
LABEL org.opencontainers.image.licenses="Apache-2.0"
COPY --from=builder /usr/src/app/bin/dlock /usr/local/bin/dlock
COPY --from=builder /usr/src/app/bin/dlockctl /usr/local/bin/dlockctl
RUN export PATH=$PATH:/usr/local/bin/dlockctl
RUN chmod +x /usr/local/bin/dlock
RUN chmod +x /usr/local/bin/dlockctl
EXPOSE 5055
ENTRYPOINT ["dlock", "--addr", "tcp4://127.0.0.1:5055"]