github.com/canhui/fabric_ca2_2@v2.0.0-alpha+incompatible/images/fabric-ca-fvt/Dockerfile (about) 1 # 2 # Copyright IBM Corp. All Rights Reserved. 3 # 4 # SPDX-License-Identifier: Apache-2.0 5 # 6 ARG BASEIMAGE_RELEASE 7 FROM hyperledger/fabric-baseimage:${BASEIMAGE_RELEASE} as fabric-ca-builder 8 ARG GO_LDFLAGS 9 ARG GO_TAGS 10 11 ADD . ${GOPATH}/src/github.com/hyperledger/fabric-ca 12 RUN go build -tags "${GO_TAGS}" -ldflags "${GO_LDFLAGS}" \ 13 -o /usr/local/bin/fabric-ca-server \ 14 github.com/hyperledger/fabric-ca/cmd/fabric-ca-server \ 15 && go build -tags "${GO_TAGS}" -ldflags "${GO_LDFLAGS}" \ 16 -o /usr/local/bin/fabric-ca-client \ 17 github.com/hyperledger/fabric-ca/cmd/fabric-ca-client; 18 19 20 FROM hyperledger/fabric-baseimage:${BASEIMAGE_RELEASE} 21 ARG PG_VER 22 23 ENV PATH="/usr/local/go/bin/:${PATH}" \ 24 DEBIAN_FRONTEND="noninteractive" \ 25 GOPATH="/opt/gopath" \ 26 PGDATA="/usr/local/pgsql/data/" \ 27 PGUSER="postgres" \ 28 PGPASSWORD="postgres" \ 29 PGSSLCERT="/etc/hyperledger/fabric-ca/FabricTlsClientEEcert.pem" \ 30 PGSSLKEY="/etc/hyperledger/fabric-ca/FabricTlsClientEEkey.pem" \ 31 PGVER=${PG_VER} \ 32 HOSTADDR="127.0.0.1" \ 33 LDAPPORT="389" \ 34 LDAPUSER="admin" \ 35 LDAPPASWD="adminpw" \ 36 FABRIC_CA_DATA=/etc/hyperledger/fabric-ca \ 37 TLS_BUNDLE=FabricTlsPkiBundle.pem \ 38 TLS_SERVER_CERT=FabricTlsServerEEcert.pem \ 39 TLS_SERVER_KEY=FabricTlsServerEEkey.pem \ 40 TLS_CLIENT_CERT=FabricTlsClientEEcert.pem \ 41 TLS_CLIENT_KEY=FabricTlsClientEEkey.pem \ 42 MYSQLDATA=/var/lib/mysql 43 44 # setup scripts for slapd, postgres, mysql, and openssl 45 COPY --from=fabric-ca-builder \ 46 ${GOPATH}/src/github.com/hyperledger/fabric-ca/images/fabric-ca-fvt/payload \ 47 ${FABRIC_CA_DATA} 48 RUN chmod +x ${FABRIC_CA_DATA}/*sh 49 RUN cd ${FABRIC_CA_DATA} 50 RUN $FABRIC_CA_DATA/tls_pki.sh 51 RUN chmod 600 ${FABRIC_CA_DATA}/${TLS_SERVER_KEY} 52 RUN chmod 600 ${FABRIC_CA_DATA}/${TLS_CLIENT_KEY} 53 54 # Avoid ERROR: 55 # invoke-rc.d: policy-rc.d denied execution of start. 56 RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d 57 58 RUN ${FABRIC_CA_DATA}/system_update.sh 59 RUN ${FABRIC_CA_DATA}/postgres_setup.sh 60 RUN ${FABRIC_CA_DATA}/slapd_setup.sh 61 RUN ${FABRIC_CA_DATA}/mysql_setup.sh 62 63 # Install fabric-ca dependencies 64 RUN go get github.com/go-sql-driver/mysql 65 RUN go get github.com/lib/pq 66 67 # Add docker-built execs for (potentially) alternative architecture 68 COPY --from=fabric-ca-builder /usr/local/bin /usr/local/bin 69 70 WORKDIR ${GOPATH}/src/github.com/hyperledger/fabric-ca 71 RUN cp ${FABRIC_CA_DATA}/start.sh / 72 ENTRYPOINT [ "/start.sh" ] 73 CMD ["scripts/run_fvt_tests"]