forked from 0xPolygon/bor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 1.1 KB
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
# ─── BUILDER STAGE ───────────────────────────────────────────────────────────────
FROM golang:1.24-alpine AS builder
ARG BOR_DIR=/var/lib/bor/
ENV BOR_DIR=$BOR_DIR
RUN apk add --no-cache build-base git linux-headers
WORKDIR ${BOR_DIR}
COPY go.mod go.sum ./
RUN --mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
RUN --mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make bor
# ─── RUNTIME STAGE ────────────────────────────────────────────────────────────────
FROM alpine:latest
ARG BOR_DIR=/var/lib/bor/
ENV BOR_DIR=$BOR_DIR
RUN apk add --no-cache bash ca-certificates && \
mkdir -p ${BOR_DIR}
WORKDIR ${BOR_DIR}
COPY --from=builder ${BOR_DIR}/build/bin/bor /usr/bin/
EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]