Skip to content

Commit

Permalink
[CE-445] Fix fabric-1.0 directory not found
Browse files Browse the repository at this point in the history
Fix local docker build for user dashboard failed.
Change dockerhub build for user dashboard.
Set DEBUG value directly True/False in compose files for operator
dashboard.

Change-Id: I63cf3aad19d05f51d7df577c3fdd531138753787
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Aug 30, 2018
1 parent 62700a5 commit a8fb378
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
- MONGO_HOST=mongo
- MONGO_DB=dev
- MONGODB_PORT=27017
- DEBUG=$DEV # in debug mode, service will auto-restart
- DEBUG=True # in debug mode, service will auto-restart
- LOG_LEVEL=$LOG_LEVEL # what level log will be output
- STATIC_FOLDER=$STATIC_FOLDER
- TEMPLATE_FOLDER=$TEMPLATE_FOLDER
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
- MONGO_HOST=mongo
- MONGO_DB=dev
- MONGODB_PORT=27017
- DEBUG=$DEV # in debug mode, service will auto-restart
- DEBUG=False # in debug mode, service will auto-restart
- LOG_LEVEL=$LOG_LEVEL # what level log will be output
- STATIC_FOLDER=$STATIC_FOLDER
- TEMPLATE_FOLDER=$TEMPLATE_FOLDER
Expand Down
34 changes: 26 additions & 8 deletions dockerhub/latest/user-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,39 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM busybox as builder
ENV FABRIC_VERSION_1_0 1.0.5
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)}') && \
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 && \
mkdir fabric-1.0 && tar -zxvf hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_0}.tar.gz -C fabric-1.0
ENV FABRIC_VERSION_1_2 1.2.0
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)}') && \
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 && \
mkdir fabric-1.2 && tar -zxvf hyperledger-fabric-${ARCH}-${FABRIC_VERSION_1_2}.tar.gz -C fabric-1.2
RUN cd /tmp && wget -c https://github.com/hyperledger/cello/archive/master.zip && unzip master.zip

FROM node:8.9
MAINTAINER haitao yue "hightall@me.com"
RUN cd /tmp && git clone https://github.com/hyperledger/cello.git
RUN cd /tmp/cello/user-dashboard/src && cp package.json yarn.lock / && cd / && yarn install -g --verbose
COPY --from=builder /tmp/cello-master/user-dashboard/src/package.json /
COPY --from=builder /tmp/cello-master/user-dashboard/src/yarn.lock /
COPY --from=builder /tmp/cello-master/user-dashboard/src/packages /packages
COPY --from=builder /tmp/cello-master/user-dashboard/src /var/www
COPY --from=builder /tmp/cello-master/user-dashboard/fabric/fabric-1.0 /etc/hyperledger/fabric-1.0
COPY --from=builder /tmp/cello-master/user-dashboard/fabric/fabric-1.2 /etc/hyperledger/fabric-1.2
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
RUN cd / && yarn install -g --verbose
RUN cd /packages/fabric-1.0 && yarn install
RUN cd /packages/fabric-1.2 && yarn install
ENV PATH ${PATH}:/node_modules/.bin
RUN mv /tmp/cello/user-dashboard/src /var/www
RUN cd /var/www && ln -sf /node_modules . && npm run build
WORKDIR /var/www
EXPOSE 8081

ENV FABRIC_VERSION 1.0.5
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)}') && echo $ARCH &&wget -c https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${FABRIC_VERSION}/hyperledger-fabric-${ARCH}-${FABRIC_VERSION}.tar.gz && tar -zxvf hyperledger-fabric-${ARCH}-${FABRIC_VERSION}.tar.gz && mv bin/configtxgen /usr/local/bin/configtxgen
RUN mkdir -p /etc/hyperledger
RUN mv /tmp/cello/user-dashboard/fabric/fabric /etc/hyperledger/fabric
ENV FABRIC_CFG_PATH /etc/hyperledger/fabric
COPY --from=builder /tmp/fabric-1.0/bin/configtxgen /usr/local/bin/fabric-1.0/configtxgen
COPY --from=builder /tmp/fabric-1.2/bin/configtxgen /usr/local/bin/fabric-1.2/configtxgen
ENV FABRIC_CFG_PATH /etc/hyperledger/fabric-1.0
ENV MONGO_PORT 27017

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

CMD ln -sf /node_modules . && npm run start
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a8fb378

Please sign in to comment.