OSDN Git Service

ab88607acdca43ec6478b98e82c6ee862c79ca85
[bytom/bytom.git] / Dockerfile
1 # build the image
2 # docker build -t bytom .
3
4
5
6 # Build Bytom in a stock Go builder container
7 FROM golang:1.9-alpine as builder
8
9 RUN apk add --no-cache make git
10
11 ADD . /go/src/github.com/bytom
12 RUN cd /go/src/github.com/bytom && make bytomd && make bytomcli
13
14 # Pull Bytom into a second stage deploy alpine container
15 FROM alpine:latest
16
17 RUN apk add --no-cache ca-certificates
18 COPY --from=builder /go/src/github.com/bytom/cmd/bytomd/bytomd /usr/local/bin/
19 COPY --from=builder /go/src/github.com/bytom/cmd/bytomcli/bytomcli /usr/local/bin/
20
21 EXPOSE 1999 46656 46657 9888
22
23
24
25
26 # if u r running the container the first time plz init it with 'bytomd init --chain_id testnet' and then run 'bytomd node --help' for further instructions.
27
28
29 ## sample commands
30 # docker run -it -p 9888:9888 -v ~/.bytomd:/.bytomd bytom:latest
31 # bytomd init --chain_id testnet
32 # bytomd node --web.closed --auth.disable
33 # exit
34
35 # docker run -d -p 9888:9888 -v ~/.bytomd:/.bytomd bytom:latest bytomd node --web.closed --auth.disable
36 # docker container ls
37 # docker stop <containerId>