-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
44 lines (32 loc) · 1.01 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
# Stage 1: Build the Go project
FROM golang:1.22-alpine3.19 AS go-builder
# Use build arguments for the target architecture
ARG TARGETARCH
ARG GOARCH
# Install necessary packages
RUN set -eux; apk add --no-cache ca-certificates build-base git cmake
WORKDIR /code
COPY . /code/
# Install mimalloc
RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install
ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4
RUN LEDGER_ENABLED=false GOARCH=${GOARCH} LDFLAGS="-linkmode=external -extldflags \"-L/code/mimalloc/build -lmimalloc -Wl,-z,muldefs -static\"" make build
FROM alpine:3.19
RUN addgroup minitia \
&& adduser -G minitia -D -h /minitia minitia
WORKDIR /minitia
COPY --from=go-builder /code/build/minitiad /usr/local/bin/minitiad
USER minitia
# rest server
EXPOSE 1317
# grpc
EXPOSE 9090
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657
# geth jsonrpc
EXPOSE 8545
# geth jsonrpc ws
EXPOSE 8546
CMD ["/usr/local/bin/minitiad", "version"]