forked from okx/exchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (23 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
# Simple usage with a mounted data directory:
# > docker build -t exchain .
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.exchaind:/root/.exchaind -v ~/.exchaincli:/root/.exchaincli exchain exchaind init mynode
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.exchaind:/root/.exchaind -v ~/.exchaincli:/root/.exchaincli exchain exchaind start
FROM golang:1.20.2-alpine AS build-env
# Install minimum necessary dependencies, remove packages
RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev
# Set working directory for the build
WORKDIR /go/src/github.com/okex/exchain
# Add source files
COPY . .
ENV GO111MODULE=on \
GOPROXY=http://goproxy.cn
# Build OKExChain
RUN make install
# Final image
FROM alpine:edge
WORKDIR /root
# Copy over binaries from the build-env
COPY --from=build-env /go/bin/exchaind /usr/bin/exchaind
COPY --from=build-env /go/bin/exchaincli /usr/bin/exchaincli
# Run exchaind by default, omit entrypoint to ease using container with exchaincli
CMD ["exchaind"]