github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/images/peer/Dockerfile (about) 1 # Copyright IBM Corp. All Rights Reserved. 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 5 ARG GO_VER 6 ARG ALPINE_VER 7 8 FROM alpine:${ALPINE_VER} as peer-base 9 RUN apk add --no-cache tzdata 10 # set up nsswitch.conf for Go's "netgo" implementation 11 # - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 12 # - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf 13 RUN echo 'hosts: files dns' > /etc/nsswitch.conf 14 15 FROM golang:${GO_VER}-alpine${ALPINE_VER} as golang 16 RUN apk add --no-cache \ 17 bash \ 18 gcc \ 19 git \ 20 make \ 21 musl-dev 22 ADD . $GOPATH/src/github.com/hyperledger/fabric 23 WORKDIR $GOPATH/src/github.com/hyperledger/fabric 24 25 FROM golang as peer 26 ARG GO_TAGS 27 RUN make peer GO_TAGS=${GO_TAGS} 28 29 FROM peer-base 30 ENV FABRIC_CFG_PATH /etc/hyperledger/fabric 31 VOLUME /etc/hyperledger/fabric 32 VOLUME /var/hyperledger 33 COPY --from=peer /go/src/github.com/osdi23p228/fabric/build/bin /usr/local/bin 34 COPY --from=peer /go/src/github.com/osdi23p228/fabric/sampleconfig/msp ${FABRIC_CFG_PATH}/msp 35 COPY --from=peer /go/src/github.com/osdi23p228/fabric/sampleconfig/core.yaml ${FABRIC_CFG_PATH} 36 EXPOSE 7051 37 CMD ["peer","node","start"]