neo-go/Dockerfile
Evgeniy Kulikov f640dbb331
DockerCompose: update environment
- rewrite Dockerfile
- four nodes, custom network, volume
- p2p, rpc and metrics port forwarded
- make: env_vendor, env_image, env_up, env_down and env_restart
- cleanup Makefile commands
- remove old docker-compose file

fix #497
2019-11-18 17:17:21 +03:00

38 lines
887 B
Docker

# Builder image
FROM golang:1-alpine as builder
RUN set -x \
&& apk add --no-cache git \
&& mkdir -p /tmp
COPY . /neo-go
WORKDIR /neo-go
ARG REPO=repository
ARG VERSION=dev
# https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
# go build -mod=vendor
RUN set -x \
&& export GOGC=off \
&& export GO111MODULE=on \
&& export CGO_ENABLED=0 \
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli
# Executable image
FROM scratch
ARG VERSION
LABEL version=$VERSION
WORKDIR /
COPY --from=builder /neo-go/config /config
COPY --from=builder /go/bin/neo-go /usr/bin/neo-go
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/usr/bin/neo-go"]
CMD ["node", "--config-path", "/config", "--testnet"]