github.com/hxx258456/fabric-ca-gm@v0.0.3-0.20221111064038-a268ad7e3a37/images/fabric-ca/Dockerfile (about)

     1  #
     2  # Copyright IBM Corp. All Rights Reserved.
     3  #
     4  # SPDX-License-Identifier: Apache-2.0
     5  #
     6  ARG GO_VER
     7  ARG ALPINE_VER
     8  
     9  FROM golang:${GO_VER}-alpine as builder
    10  ARG GO_LDFLAGS
    11  ARG GO_TAGS
    12  
    13  RUN sed -i "s?dl-cdn.alpinelinux.org?mirrors.aliyun.com?g" /etc/apk/repositories \
    14  	&& apk add --no-cache \
    15  	gcc \
    16  	binutils-gold \
    17  	git \
    18  	musl-dev;
    19  
    20  ADD . /build/fabric-ca
    21  WORKDIR /build/fabric-ca
    22  RUN go env -w GOPROXY=https://goproxy.cn,direct \
    23  	&& go install -tags "${GO_TAGS}" -ldflags "${GO_LDFLAGS}" \
    24  	github.com/hxx258456/fabric-ca-gm/cmd/fabric-ca-server \
    25  	&& go install -tags "${GO_TAGS}" -ldflags "${GO_LDFLAGS}" \
    26  	github.com/hxx258456/fabric-ca-gm/cmd/fabric-ca-client
    27  
    28  
    29  FROM alpine:${ALPINE_VER}
    30  ENV TIME_ZONE=Asia/Shanghai LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server BOOTSTRAP_USER_PASS=admin:adminpw
    31  COPY --from=builder /go/bin /usr/local/bin
    32  RUN \
    33  	sed -i "s?dl-cdn.alpinelinux.org?mirrors.aliyun.com?g" /etc/apk/repositories \
    34  	&& apk add --no-cache tzdata \
    35  	&& echo "${TIME_ZONE}" > /etc/timezone \
    36  	&& ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
    37  	&& mkdir -p /etc/hyperledger/fabric-ca-client/tls-root-cert \
    38  	&& echo 'fabric-ca-server start -b ${BOOTSTRAP_USER_PASS} -d' > /usr/local/bin/start_ca.sh \
    39  	&& chmod +x /usr/local/bin/start_ca.sh
    40  EXPOSE 7054
    41  # CMD fabric-ca-server start -b ${BOOTSTRAP_USER_PASS}
    42  CMD /usr/local/bin/start_ca.sh