forked from tikv/pd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 798 Bytes
/
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
FROM golang:1.19-alpine as builder
RUN apk add --no-cache \
make \
git \
bash \
curl \
gcc \
g++
# Install jq for pd-ctl
RUN cd / && \
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O jq && \
chmod +x jq
RUN mkdir -p /go/src/github.com/tikv/pd
WORKDIR /go/src/github.com/tikv/pd
# Cache dependencies
COPY go.mod .
COPY go.sum .
RUN GO111MODULE=on go mod download
COPY . .
RUN make
FROM alpine:3.5
COPY --from=builder /go/src/github.com/tikv/pd/bin/pd-server /pd-server
COPY --from=builder /go/src/github.com/tikv/pd/bin/pd-ctl /pd-ctl
COPY --from=builder /go/src/github.com/tikv/pd/bin/pd-recover /pd-recover
COPY --from=builder /jq /usr/local/bin/jq
RUN apk add --no-cache \
curl
EXPOSE 2379 2380
ENTRYPOINT ["/pd-server"]