HyperledgerHandsOn / trade-finance-logistics

Trade Finance and Logistics based on Letter of Credit and Proof of Shipment
Apache License 2.0
178 stars 1.5k forks source link

Error with creating docker image #63

Closed zzinny closed 5 years ago

zzinny commented 5 years ago

I got an error while making docker image. (fabric v1.1)

Error log:

Building docker javaenv-image
docker build -t hyperledger/fabric-javaenv build/image/javaenv
Sending build context to Docker daemon 56.83kB
Step 1/15 : FROM hyperledger/fabric-baseimage:x86_64-0.4.6
x86_64-0.4.6: Pulling from hyperledger/fabric-baseimage
1be7f2b886e8: Pull complete
6fbc4a21b806: Pull complete
c71a6f8e1378: Pull complete
4be3072e5a37: Pull complete
06c6d2f59700: Pull complete
4d536120d8a5: Pull complete
0baaf9ec263e: Pull complete
3ea9b6cc6f21: Pull complete
6173b9a5fe5e: Pull complete
e73719e0bcbe: Pull complete
b55408c6ced5: Pull complete
Digest: sha256:4bd7a050fbd0470d47fe1eb983bc1e32a826d6b7e5f81a694ac3928375b2321f
Status: Downloaded newer image for hyperledger/fabric-baseimage:x86_64-0.4.6
---> dbe6787b5747
Step 2/15 : RUN curl -sSL https://services.gradle.org/distributions/gradle-2.12-bin.zip > /tmp/gradle-2.12-bin.zip
---> Running in 29d85ae02613
Removing intermediate container 29d85ae02613
---> ba09b3d9d047
Step 3/15 : RUN unzip -qo /tmp/gradle-2.12-bin.zip -d /opt && rm /tmp/gradle-2.12-bin.zip
---> Running in ada7cdbcbd60
Removing intermediate container ada7cdbcbd60
---> 7ea5761088e8
Step 4/15 : RUN ln -s /opt/gradle-2.12/bin/gradle /usr/bin
---> Running in 7599788dfcf0
Removing intermediate container 7599788dfcf0
---> 11e6893b6cfd
Step 5/15 : ENV MAVEN_VERSION=3.3.9
---> Running in 95aa96d69576
Removing intermediate container 95aa96d69576
---> 4cc6e601830b
Step 6/15 : ENV USER_HOME_DIR="/root"
---> Running in f696b1c0a8b0
Removing intermediate container f696b1c0a8b0
---> c97fe6ae1e69
Step 7/15 : RUN mkdir -p /usr/share/maven /usr/share/maven/ref && curl -fsSL https://nexus.hyperledger.org/content/repositories/hosted_installers/apache-maven/apache-maven/$MAVEN_VERSION/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
---> Running in a68701b248ca
Removing intermediate container a68701b248ca
---> 296e480c535d
Step 8/15 : ENV MAVEN_HOME /usr/share/maven
---> Running in e8587ba3613b
Removing intermediate container e8587ba3613b
---> 526320177290
Step 9/15 : ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
---> Running in 8b95519017ec
Removing intermediate container 8b95519017ec
---> 8b5aabab8a16
Step 10/15 : ADD payload/javashim.tar.bz2 /root
failed to copy files: Error processing tar file(bzip2 data invalid: bad magic value in continuation file):
make: *** [build/image/javaenv/.dummy-x86_64-1.1.2-snapshot-5cf10e92] Error 1

I tried the solution of issue #61 and confirmed that tar command executes gnu-tar by tar --version.

But the error still occurs. Why?

VRamakrishna commented 5 years ago

Why are you building hyperleder/fabric-javaenv?

Our project uses Golang chaincode for which you only need to build the hyperledger/fabric-ccenv image; this should be built by make docker.

(Regarding the error, I would guess it has something to do with MAVEN_VERSION not being defined in Step 7.)

I would recommend bypassing this particular image build regardless of whether you can fix the error.

zzinny commented 5 years ago

I just make docker at hyperledger/fabric. How can I build hyperledger/fabric-ccenv not javaenv?

VRamakrishna commented 5 years ago

Replace lines 255 and 256 in hyperledger/fabric/Makefile with the following and retry make docker:

build/bin/peer: build/image/ccenv/$(DUMMY)
build/image/peer/$(DUMMY): build/image/ccenv/$(DUMMY)
zzinny commented 5 years ago

Thanks!