Skip to content

Commit cef231c

Browse files
committed
[FABCJ-293] Remove gradle from image
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
1 parent 89b527f commit cef231c

File tree

7 files changed

+7
-296
lines changed

7 files changed

+7
-296
lines changed

COMPATIBILITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Architecture Support: all docker images, JVMs, tools are tested under x86_64 ON
4646

4747
When using Fabric 2.1.0, the default docker image that is used to run the Java chaincode is *openjdk11:jdk-11.04_11-alpine*
4848

49-
With the default docker image used by Fabric 2.1.0. should the packaged Java code contains a maven or gradle build script, it will be built using Gradle 5.6.2, or Maven 3.6.2 (if both Gradle and Maven files are present Gradle is used. Gradle build files can be groovy, or kotlin. If the Gradle wrapper is present, this will used in preference to the installed version of Gradle)
49+
With the default docker image used by Fabric 2.1.0. should the packaged Java code contain a Maven or Gradle build script, it will be built using Gradle 5.6.2, or Maven 3.6.2 (if both Gradle and Maven files are present Gradle is used. Gradle build files can be groovy, or kotlin. If the Gradle wrapper is present, this will used in preference to the installed version of Gradle; note that the version of Gradle in the docker image is a copy of the Gradle Wrapper, not the full Gradle install. Therefore if there is limited Internet acccess in your production environment, do not use Gradle). Alternatively it is recommended to package prebuilt jar files, including the contract and all dependencies, in which case no build or Internet access is required when installing Java chaincode.
5050

5151
### Supported Runtime communication with the Peer
5252

fabric-chaincode-docker/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ RUN mvn -f pom-default.xml compile
5656
WORKDIR /root/chaincode-java
5757
RUN rm -rf shim-src
5858

59+
RUN gradle wrapper
60+
5961
# Creating final javaenv image which will include all required
6062
# dependencies to build and compile java chaincode
6163
FROM adoptopenjdk/openjdk11:jdk-11.0.4_11-alpine
6264
RUN apk add --no-cache bash
63-
COPY --from=builder /root/.sdkman/candidates/gradle/current /usr/bin/gradle
65+
66+
COPY --from=dependencies /root/chaincode-java/gradle /root/chaincode-java/
67+
COPY --from=dependencies /root/chaincode-java/gradlew /root/chaincode-java/gradlew
6468
COPY --from=builder /root/.sdkman/candidates/maven/current /usr/bin/maven
6569

6670
SHELL ["/bin/bash", "-c"]

fabric-chaincode-docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ buildGradle() {
1717
chmod +x ./gradlew
1818
./gradlew build shadowJar -x test
1919
else
20-
gradle build shadowJar -x test
20+
/root/chaincode-java/gradlew build shadowJar -x test
2121
fi
2222
retval=$?
2323
if [ $retval -ne 0 ]; then

fabric-chaincode-integration-test/src/contracts/fabric-chaincode-example-sacc/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

fabric-chaincode-integration-test/src/contracts/fabric-chaincode-example-sacc/gradlew

Lines changed: 0 additions & 188 deletions
This file was deleted.

fabric-chaincode-integration-test/src/contracts/fabric-chaincode-example-sacc/gradlew.bat

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)