forked from bnb-chain/node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (25 loc) · 959 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
FROM golang:1.11-alpine AS build-env
# Set up dependencies
ENV PACKAGES make git libc-dev bash gcc linux-headers eudev-dev curl ca-certificates ssh
# Set working directory for the build
WORKDIR /go/src/github.com/bnb-chain/node
# Add source files
COPY . .
# Add ssh key to download private deps
COPY ~/.ssh/id_rsa /root/ssh/
# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN apk add --no-cache $PACKAGES && \
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh && \
make get_vendor_deps && \
make build-alpine && \
make install
# Final image
FROM alpine:edge
# Install ca-certificates
RUN apk add --update ca-certificates
WORKDIR /root
# Copy over binaries from the build-env
COPY --from=build-env /go/bin/bnbchaind /usr/bin/bnbchaind
COPY --from=build-env /go/bin/bnbcli /usr/bin/bnbcli
# Run gaiad by default, omit entrypoint to ease using container with gaiacli
CMD ["bnbchaind"]