Dockerfile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright IBM Corp, All Rights Reserved.
  2. #
  3. # SPDX-License-Identifier: Apache-2.0
  4. #
  5. FROM busybox as builder
  6. ENV FABRIC_VERSION_1_0 1.0.5
  7. RUN cd /tmp && ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}') && \
  8. echo $ARCH &&wget -c https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${FABRIC_VERSION_1_0}/hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_0}.tar.gz && \
  9. mkdir fabric-1.0 && tar -zxvf hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_0}.tar.gz -C fabric-1.0
  10. ENV FABRIC_VERSION_1_2 1.2.0
  11. RUN cd /tmp && ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}') && \
  12. echo $ARCH &&wget -c https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${FABRIC_VERSION_1_2}/hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_2}.tar.gz && \
  13. mkdir fabric-1.2 && tar -zxvf hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_2}.tar.gz -C fabric-1.2
  14. RUN cd /tmp && wget -c https://github.com/hyperledger/cello/archive/master.zip && unzip master.zip
  15. FROM node:8.9
  16. MAINTAINER haitao yue "hightall@me.com"
  17. COPY --from=builder /tmp/cello-master/user-dashboard/src/package.json /
  18. COPY --from=builder /tmp/cello-master/user-dashboard/src/yarn.lock /
  19. COPY --from=builder /tmp/cello-master/user-dashboard/src/packages /packages
  20. COPY --from=builder /tmp/cello-master/user-dashboard/src /var/www
  21. COPY --from=builder /tmp/cello-master/user-dashboard/fabric/fabric-1.0 /etc/hyperledger/fabric-1.0
  22. COPY --from=builder /tmp/cello-master/user-dashboard/fabric/fabric-1.2 /etc/hyperledger/fabric-1.2
  23. COPY --from=builder /tmp/cello-master/user-dashboard/src/app/lib/fabric/fixtures/channel/v1.2/crypto-config /etc/hyperledger/fabric-1.2/crypto-config
  24. RUN cd / && yarn install -g --verbose
  25. RUN cd /packages/fabric-1.0 && yarn install
  26. RUN cd /packages/fabric-1.2 && yarn install
  27. ENV PATH ${PATH}:/node_modules/.bin
  28. RUN cd /var/www && ln -sf /node_modules . && npm run build
  29. WORKDIR /var/www
  30. EXPOSE 8081
  31. COPY --from=builder /tmp/fabric-1.0/bin/configtxgen /usr/local/bin/fabric-1.0/configtxgen
  32. COPY --from=builder /tmp/fabric-1.2/bin/configtxgen /usr/local/bin/fabric-1.2/configtxgen
  33. ENV FABRIC_CFG_PATH /etc/hyperledger/fabric-1.0
  34. ENV MONGO_PORT 27017
  35. RUN sed -i 's/.\/ecdsa\/key.js/fabric-client\/lib\/impl\/ecdsa\/key.js/g' /packages/fabric-1.2/node_modules/fabric-ca-client/lib/impl/CryptoSuite_ECDSA_AES.js
  36. CMD ln -sf /node_modules . && npm run start