Giter Club home page Giter Club logo

docker-gradle's Introduction

docker-gradle

Supported tags and respective Dockerfile links

lts-and-current images

Gradle's support for new Java releases historically has lagged for multiple months. This means most users wanting to use the latest Java release will need to do so using toolchains. Toolchains are documented here and here for GraalVM. The lts-and-current images provide both the latest LTS JDK and the latest (LTS or non-LTS) JDK. This allows Gradle to be launched with a supported JDK (the latest LTS release) and configure the compilation using toolchains to use the latest current JDK. This is done by putting the content below in /home/gradle/.gradle/gradle.properties.

org.gradle.java.installations.auto-detect=false
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=JAVA_LTS_HOME,JAVA_CURRENT_HOME

The JAVA_LTS_HOME environment variable points to the path where the latest LTS JDK is installed and JAVA_CURRENT_HOME points to the latest current JDK. These may point to the same path if the latest JDK is an LTS release.

What is Gradle?

Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing websites. Gradle has been designed to support build automation across multiple languages and platforms including Java, Scala, Android, C/C++, and Groovy, and is closely integrated with development tools and continuous integration servers including Eclipse, IntelliJ, and Jenkins.

How to use this image

If you are mounting a volume and the uid/gid running Docker is not 1000, you should run as user root (-u root). root is also the default, so you can also simply not specify a user.

Building a Gradle project

Run this from the directory of the Gradle project you want to build.

Bash/Zsh

docker run --rm -u gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:latest gradle <gradle-task>

PowerShell

docker run --rm -u gradle -v "${pwd}:/home/gradle/project" -w /home/gradle/project gradle:latest gradle <gradle-task>

Windows CMD

docker run --rm -u gradle -v "%cd%:/home/gradle/project" -w /home/gradle/project gradle:latest gradle <gradle-task>

Note the above command runs using uid/gid 1000 (user gradle) to avoid running as root.

Reusing the Gradle cache

The local Gradle cache can be reused across containers by creating a volume and mounting it to /home/gradle/.gradle. Note that sharing between concurrently running containers doesn't work currently (see #851).

Also, currently it's not possible to override the volume declaration of the parent. So if you are using this image as a base image and want the Gradle cache to be written into the next layer, you will need to use a new user (or use the --gradle-user-home/-g argument) so that a new cache is created that isn't mounted to a volume.

docker volume create --name gradle-cache
docker run --rm -u gradle -v gradle-cache:/home/gradle/.gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:latest gradle <gradle-task>

Instructions for a new Gradle release

  1. Run update.sh or update.ps1.
  2. Commit and push the changes.
  3. Update official-images (and docs if appropriate).

Build status badge

docker-gradle's People

Contributors

benkard avatar chadlwilson avatar j0wi avatar josmo avatar jurriaan avatar keeganwitt avatar m-burst avatar nycodeghg avatar richyhbm avatar sineaggi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-gradle's Issues

Remove restriction on running as root or UID 1000

https://hub.docker.com/_/gradle/ mentions that if mounting a volume and not running Docker as UID 1000 you should run commands as root. This hinders development since some files within the development environment have to be dealt with as root.

As an aside, I assume you mean running Docker as UID 1000 or root, because running commands as the default user works fine with Docker running as root here. Or maybe I'm running into a different issue (only on Travis CI):

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

simple gradle question

how do i run multiple gradle tasks?

for example: docker run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project gradle gradle

Simple Gradle/Docker Usage Question

I have a simple Java server project with a build.gradle script. gradle run runs perfectly on my laptop.

Ideally, there would be a reference example for writing Dockerfiles that use the gradle base Docker image. Here is my attempt for a simple project:

FROM gradle:4.3-jdk-alpine
ADD . /code
WORKDIR /code
CMD ["gradle", "--stacktrace", "run"]

I build it with docker build -t my-server-app .

Then I run with docker run --rm my-server-app

The error I get is:

Caused by: org.gradle.api.UncheckedIOException: Failed to create parent directory '/code/.gradle/4.3' when creating directory '/code/.gradle/4.3/fileHashes'
	at org.gradle.util.GFileUtils.mkdirs(GFileUtils.java:271)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:56)

Obviously, the docker container should be running as root. Why would I get this error?

error: could not lock config file /home/gradle/.gitconfig: Permission denied

I am using gradle container in Concourse.CI

unit-test.yml

platform: linux

image_resource:
type: docker-image
source:
repository: gradle
tag: latest
...

Source downloads but when it comes time to invoke gradlew, ....

I receive:

error: could not lock config file /home/gradle/.gitconfig: Permission denied

gradle:4.6.0-jdk10 contains Java 9

My nightly CI has started failing for the same commit, is this because gradle:4.6.0-jdk10 now contains Java 9?

Using Docker executor with image gradle:4.6.0-jdk10 ...
Pulling docker image gradle:4.6.0-jdk10 ...
Using docker image sha256:d153ea153aafb79c385611b519ae5ddad26cf0cff660be042c130fe2ae636db9 for gradle:4.6.0-jdk10 ...
Checking out 95fae091 as master...
$ java -version
openjdk version "9.0.4"
OpenJDK Runtime Environment (build 9.0.4+12-Debian-2)
OpenJDK 64-Bit Server VM (build 9.0.4+12-Debian-2, mixed mode)
$ gradle --version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/opt/gradle/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          9.0.4 (Oracle Corporation 9.0.4+12-Debian-2)
OS:           Linux 4.13.9-coreos amd64

Whilst my build from the night before worked but with a previous docker image:

Using Docker executor with image gradle:4.6.0-jdk10 ...
Pulling docker image gradle:4.6.0-jdk10 ...
Using docker image sha256:054130b6e60cbfe8b07845be853d556d37c9b1ff38afc13339c2ee48eb6d5901 for gradle:4.6.0-jdk10 ...
Checking out 95fae091 as master...
$ uname -a
Linux runner-4e4528ca-project-1923235-concurrent-0 4.13.9-coreos #1 SMP Thu Oct 26 03:21:00 UTC 2017 x86_64 GNU/Linux
$ java -version
openjdk version "10" 2018-03-20
OpenJDK Runtime Environment (build 10+46-Debian-2)
OpenJDK 64-Bit Server VM (build 10+46-Debian-2, mixed mode)
$ gradle --version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/opt/gradle/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          10 (Oracle Corporation 10+46-Debian-2)
OS:           Linux 4.13.9-coreos amd64

Gradle 5 RC Builds

It seems wise to test Gradle 5 end to end before it's release. Is the current plan to wait for 5.0 release and then provide the 5.0 images?

Issue with Gradle on JDK 9

I have the same build.gradle file but one I've use with gradle:latest and second one with gradle:4.2.0-jdk9. What is my problem, that with second one I've got an error:

java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

I suspect this has to do something with ca-certificates/ca-certificates-java package.
This is full error stacktrace:

     Required by:
         project :
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M3.
         > Could not get resource 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M3.
         > Could not get resource 'https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
            > Could not GET 'https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M3.
         > Could not get resource 'https://repo.spring.io/milestone/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
            > Could not GET 'https://repo.spring.io/milestone/org/springframework/boot/spring-boot-gradle-plugin/2.0.0.M3/spring-boot-gradle-plugin-2.0.0.M3.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51.
         > Could not get resource 'https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51.
         > Could not get resource 'https://repo.spring.io/snapshot/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
            > Could not GET 'https://repo.spring.io/snapshot/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51.
         > Could not get resource 'https://repo.spring.io/milestone/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
            > Could not GET 'https://repo.spring.io/milestone/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.51/kotlin-gradle-plugin-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve org.jetbrains.kotlin:kotlin-allopen:1.1.51.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-allopen:1.1.51.
         > Could not get resource 'https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.jetbrains.kotlin:kotlin-allopen:1.1.51.
         > Could not get resource 'https://repo.spring.io/snapshot/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
            > Could not GET 'https://repo.spring.io/snapshot/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.jetbrains.kotlin:kotlin-allopen:1.1.51.
         > Could not get resource 'https://repo.spring.io/milestone/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
            > Could not GET 'https://repo.spring.io/milestone/org/jetbrains/kotlin/kotlin-allopen/1.1.51/kotlin-allopen-1.1.51.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Cannot extend image

Would like to add some componets but I am not able to switch to the root user.
Is it possible to provide the root password or an alternative? By default the gradle user is active on the image.

Like to add a chrome headless browser to perform Serenity tests on the image as well.

apt-get update triggers an error because the gradle user does not have the rights to alter something outside the usr dir of the user.

Can't start Gradle when running in Travis CI as gradle user

The Gradle daemon won't start when running as the "gradle" user on Travis CI (make test):

> Starting Daemonon'. Working directory: /home/gradle/.gradle/daemon/4.5.1 Command: /usr/lib/jvm/java-8-openjdk-amd64/bin/java -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /opt/gradle/lib/gradle-launcher-4.5.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.5.1
Successfully started process 'Gradle build daemon'
> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemon> Starting Daemonpt to start the daemon took 0.936 secs.
 the daemon (pid: 33). The daemon log file: /home/gradle/.gradle/daemon/4.5.1/daemon-33.out.log
Starting build in new daemon [memory: 954.7 MB]
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s

I can't reproduce this locally, but I get a possibly related issue when running as "nobody" (make GRADLE_USER=nobody test):

FAILURE: Build failed with an exception.

* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

User 'gradle' can't use Testcontainers library inside gitlab-ci runner

In addition to #10 and conversation about which user (root or gradle) is better to use.

In tests we use Testcontainers library. To start containers it requires /var/run/docker.sock which is owned by root:docker.

We use Gitlab-CI to build our projects and run tests.

So when Gitlab-CI pipeline executes tests using testcontainers, it fails because user gradle has no permissions to access docker.sock file.

The problem is that you can not specify user to run container in gitlab-ci (but there is a feature request in their repo), you can not use sudo gradle build inside container (because gradle images haven't sudo).

Proposal:

  • add user gradle to group docker (I don't know is it ok?) or
  • use root user instead gradle or
  • make me use own image-wrapper with USER: root or your docker-gradle-root image.

Gradle in re-downloading images in child images

Hi, I have these images:

image1

FROM gradle:jdk8-alpine
RUN ["sh", "-c", "gradle clean build distTar"]

(downloads dependencies)
.
.
.

Image2

FROM image1
CMD gradle clean test

(downloads dependencies again)
.
.
.

When image2 builds right after image1, it re-downloads dependencies. Shouldn't the deps be embedded in image1?

Pretty new to docker.

Why does the gradle image run by default as a gradle user?

I searched Google and found that many people made mistakes because of this line of code. And I use Drone CI Service to start gradle image to build software, cannot specify a image to run as root , so this problem is very difficult to solve.

USER gradle

I use the gradle:latest image, the solution I used is copy to home dir, but is just a workaround, there are many inconveniences for the latter operations.

- cp -R . ~/src
- cd ~/src
- ./gradlew assemble

Now i switched to the openjdk:latest image, which runs as root by default. just:

- ./gradlew assemble

Provide stretch slim for stretch based images

A number of the images make use of debian stretch, these could make use of stretch slim instead and would only require installing wget and unzip. Alternatively maybe providing slim alternatives would be preferred? (As a number of images will rely on some of the base debian tools being preinstalled)

FROM openjdk:8-jdk-slim-stretch
RUN apt-get update && apt-get install -y --no-install-recommends wget unzip

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

My Dockerfile looks like this:

FROM openjdk:8-jdk-alpine AS TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY build.gradle settings.gradle $APP_HOME
COPY gradle $APP_HOME/gradle
COPY . .
RUN ./gradlew dependencies

And I run it just fine with

docker build -t test:latest .

Now I want to change to the gradle:5.2.0-jdk8-alpine image so I don't have to download gradle using the wrapper each time. The first thing I did though was to just change the image name and check if it all works still:

FROM gradle:5.2.0-jdk8-alpine as TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY build.gradle settings.gradle $APP_HOME
COPY gradle $APP_HOME/gradle
COPY . .
RUN ./gradlew dependencies

But I get the error

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

I still get this error if I put USER gradle at the top of the dockerfile.

There is something in the docs on dockerhub to changing to root user if you are mounting a volume.

But as you can see, I'm not mounting a volume.

I realise that there is some user permission issue going on but I don't understand what is different about this image that is causing it or how to modify my Dockerfile to fix it.

link question

why use ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle
rather than cp gradle to /usr/bin ????

3.5 tag gets gradle 4.0

Dockerhub 3.5 tags are pulling down gradle 4.0 which ended up breaking a CI test as it was checking for 3.5

ssh missing in version 5.4

looks like ssh is missing in the newest image.. Any plans on adding it back in or is this on purpose?

I use ssh to setup ssh tunnels so that gradle can update databases during deploy/testing

4.6 images

Gradle recently release its 4.6 version. Plans on providing this?

Problems pulling the image

Trying to docker pull gradle:alpine

throws this error:
alpine: Pulling from library/gradle
no matching manifest for unknown in the manifest list entries

Other images (not gradle) are normal

Directory getting created as root user

Hello,

I am using gradle 4.6 container ( https://github.com/keeganwitt/docker-gradle/blob/1fcbfdaa2566e3cf3fb055fbd1342f2aa462bb85/jdk8/Dockerfile) inside my Jenkinsfile. The problem I notice is that

jenkins-slave-3ktjm-rvr6b:~# ls -la /home/gradle/
total 48
drwxr-xr-x. 4 gradle gradle 4096 Mar 27 14:40 .
drwxr-xr-x. 1 root   root   4096 Mar 27 14:40 ..
-rw-r--r--. 5 gradle gradle  220 May 15  2017 .bash_logout
-rw-r--r--. 5 gradle gradle 3526 May 15  2017 .bashrc
drwxr-xr-x. 2 root   root     60 Mar 27 14:40 .gradle
-rw-r--r--. 5 gradle gradle  675 May 15  2017 .profile
drwxr-xr-x. 4 root   root   4096 Mar 27 14:40 native

The .gradle directory is created as root user. This makes my pipeline to fail due to permission issues.

cannot create /home/gradle/.gradle/gradle.properties: Permission denied

I am creating that file with some details for access maven repo. I am not sure if this is the right place to ask this question, as it could be a problem in the way am doing it. Any help would be greatly appreciated.

Thanks

cache folder empty on build

I have a cache docker builder that will download the resources and build a cache

FROM gradle:jdk8-alpine as cache-builder

#  gradle docker runs with gradle user and files are copied as root
USER 0
WORKDIR /src
COPY . /src
RUN gradle assemble --no-daemon --build-cache

later the cache is used to copy to another multistage docker.

FROM gradle:jdk8-alpine as builder

EXPOSE 8080

#  gradle docker runs with gradle user and files are copied as root
USER 0
WORKDIR /src
COPY --from=cache-builder /home/gradle/.gradle/caches /home/gradle/.gradle/caches
COPY . /src
RUN gradle clean assemble --offline --no-daemon


FROM openjdk:8-jre-alpine as app
WORKDIR /app
CMD java -jar ./app.jar application.yml
COPY --from=builder /src/build/libs/*.jar /app/app.jar

ARG RELEASE_ENV
ENV RELEASE_ENV_ARG=$RELEASE_ENV
COPY config/application.yml.$RELEASE_ENV_ARG /app/application.yml

if i doc docker run cache-builder, and run gradle assemble --no-daemon --build-cache it will save the cache in /home/gradle/.gradle/caches
But when i try to do docker build of the cache-builder and later try to copy , the folder is empty.

Not sure if it is caused because that mountpoint is a docker volume?
Should i change the location where the cache is saved?

Thanks in advance

Reconsider AdoptOpenJDK as too buggy.

We encounter severe problems with Adopt.
The fact is that all Adopt builds (8,11,12) of OpenJDK have a fonts issue.
This is very unfortunate that many teams and Docker image maintainers adopt Adopt...
Having Apache POI library for processing Excel spreadsheets in a modern (not old legacy) application any Adopt build will fail executing POI when it tries to load fonts (N.B. With NO LOGGING of an error for Java 8, only 11, 12 logs exception).
Basically anyone using Apache POI, for example, and building or, say, testing application in Docker in CI pipeline using new official Gradle Docker images will encounter this. So, for now any new tag of official Docker image contains a bug.
please see:
https://github.com/AdoptOpenJDK/openjdk-build/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+font

adoptium/temurin-build#693

Should this be addressed to supply more reliable official Gradle Docker images?

Support arm32v7 architecture

It would be really usefull if this image was available for various arm-architectures for running it on arm servers, embedded devices or raspberry pis

Failed to load native library 'libnative-platform.so' for Linux amd64.

I am running on a Linux hosted OpenShift container and trying to execute builds using Gitlab CI Runner. I get the following error when using the Gradle Docker images:

Failed to load native library 'libnative-platform.so' for Linux amd64.

If I use the gradle:4.2.0-jdk8 I get the error. If I use image: java:8 I do not get the error. I tried adding the stacktrace and info options but it fails right away before supplying any help.

I saw there a similar issue that was closed but he said it had to do with OS X so this seems different.

Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on gitlab-runner-1-bv0xl (53cb5409)
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image gradle:4.2.0-jdk8 ...
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Waiting for pod gitlab-runner/runner-53cb5409-project-586-concurrent-0w41s5 to be running, status is Pending
Running on runner-53cb5409-project-586-concurrent-0w41s5 via gitlab-runner-1-bv0xl...
Cloning repository...
Cloning into '/may/algorithms'...
Checking out 262fdd32 as master...
Skipping Git submodules setup
Checking cache for master...
Successfully extracted cache
$ export GRADLE_USER_HOME=`pwd`/.gradle
$ gradle --build-cache --stacktrace --info assemble

FAILURE: Build failed with an exception.

* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1

Gradle version of some docker tags not v5.0

Docker hub ref: https://hub.docker.com/_/gradle/

Tags 5.0.0-jdk8-alpine, 5.0-jdk8-alpine, jdk8-alpine, 5.0.0-jdk-alpine, 5.0-jdk-alpine, jdk-alpine, 5.0.0-alpine, 5.0-alpine, alpine (jdk8-alpine/Dockerfile) link to the same Dockerfile.
But the gradle version not the same v5.0

  • jdk8
docker run --rm -it gradle:jdk8 gradle -v

------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Linux 3.10.0-957.1.3.el7.x86_64 amd64
  • jdk8-alpine
docker run --rm -it gradle:jdk8-alpine gradle -v

------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Linux 3.10.0-957.1.3.el7.x86_64 amd64
  • jdk-alpine
docker run --rm -it gradle:jdk-alpine gradle -v

------------------------------------------------------------
Gradle 4.10
------------------------------------------------------------

Build time:   2018-08-27 18:35:06 UTC
Revision:     ee3751ed9f2034effc1f0072c2b2ee74b5dce67d

Kotlin DSL:   1.0-rc-3
Kotlin:       1.2.60
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_171 (Oracle Corporation 25.171-b11)
OS:           Linux 3.10.0-957.1.3.el7.x86_64 amd64
  • alpine
docker run --rm -it gradle:alpine gradle -v

------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Linux 3.10.0-957.1.3.el7.x86_64 amd64
  • 5.0-alpine
docker run --rm -it gradle:5.0-alpine gradle -v

------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------

Build time:   2018-11-26 11:48:43 UTC
Revision:     7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

Kotlin DSL:   1.0.4
Kotlin:       1.3.10
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Linux 3.10.0-957.1.3.el7.x86_64 amd64

Failed to create parent directory '/project/.gradle' when creating directory

env:

  • win 10
  • docker for windows

command

docker run --rm -v .:/project -w /project --name gradle gradle:3.4-jdk8 gradle test

error

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to create parent directory '/project/.gradle' when creating directory '/project/.gradle/buildOutputCleanup'

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.848 secs

Cannot use nodejs plugin with Gradle

I use NodeJS plugin for one of my projects.

https://github.com/srs/gradle-node-plugin

When I try to use the gradle:5.2-jre8-alpine image, Gradle fails with the following error. It seems Gradle didn't even download nodejs in order to be executed:

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :website:assemble UP-TO-DATE
> Task :website:nodeSetup UP-TO-DATE

FAILURE: > Task :website:yarnSetup FAILED
Build failed with an exception.

* What went wrong:
Execution failed for task ':website:yarnSetup'.
> A problem occurred starting process 'command '/home/gradle/project/website/.gradle/nodejs/node-v10.14.2-linux-x64/bin/node''

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

I then tried gradle:5.2-jre8 image but this time I got a little bit more useful info in the stacktrace:

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :website:assemble UP-TO-DATE
> Task :website:nodeSetup UP-TO-DATE

> Task :website:yarnSetup
/home/gradle/project/website/.gradle/yarn/yarn-v1.12.3/bin/yarn -> /home/gradle/project/website/.gradle/yarn/yarn-v1.12.3/lib/node_modules/yarn/bin/yarn.js
/home/gradle/project/website/.gradle/yarn/yarn-v1.12.3/bin/yarnpkg -> /home/gradle/project/website/.gradle/yarn/yarn-v1.12.3/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
updated 1 package in 2.533s

> Task :website:yarn_install
yarn install v1.12.3
warning package.json: No license field
warning No license field[1/4] Resolving packages...
[2/4] Fetching packages...

[3/4] Linking dependencies...
warning "markdown-spellcheck > [email protected]" has unmet peer dependency "sinon@1".
[4/4] Building fresh packages...
error /home/gradle/project/website/node_modules/gifsicle: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /home/gradle/project/website/node_modules/gifsicle
Output:
⚠ Command failed: /home/gradle/project/website/node_modules/gifsicle/vendor/gifsicle --version
/home/gradle/project/website/node_modules/gifsicle/vendor/gifsicle: 1: /home/gradle/project/website/node_modules/gifsicle/vendor/gifsicle: Syntax error: "(" unexpected


  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -ivf
/bin/sh: 1: autoreconf: not found


    at Promise.all.then.arr (/home/gradle/project/website/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

> Task :website:yarn_install FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':website:yarn_install'.
> Process 'command '/home/gradle/project/website/.gradle/yarn/yarn-v1.12.3/bin/yarn'' finished with non-zero exit value 1

I think certain library is missing from the base image and that's why node/yarn is not running.

User 'gradle' can't create directories when binding local directory with '-v'

I'm following the example from the official repo, in a Docker for Windows.
But I got this error:

$ docker run --rm -v "$PWD":/project -w /project --name gradle gradle:alpine gradle tasks
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Failed to create directory '/project/.gradle/buildOutputCleanup'

If I change the command for a ls -la the folder owner is root and not gradle (who executes the commands):

$ docker run --rm -v //c/develop/my-folder:/project -w /project --name gradle gradle:alpine ls -la
total 8
drwxr-xr-x    2 root     root             0 Mar 31 20:06 .
drwxr-xr-x    1 root     root          4096 Mar 31 20:06 ..
-rwxr-xr-x    1 root     root           949 Mar 31 20:06 pom.xml

Watching other code-building and language containers:

don't use USER directive. Is there any reason to use in this case?

JDK 12 support

Will JDK 12 be supported by the docker-gradle image? Thanks

amd64 builds are not available

This image is being used in our pipeline, but failed.
I investigated this issue and apparently a lot of builds are not
available. The following error is printed:

no matching manifest for linux/amd64 in the manifest list entries

I tried the following images:

  1. gradle:4.10-jre-alpine
  2. gradle:alpine

The following image does work still: gradle:4.9.0-jdk8-slim, but isn't of use
to me because I rely on Alpine specific stuff (ash).

I also noted the build pipeline for these images hangs: link.

gradle:5.0.0-jdk11 fails to resolve maven central dependencies: trustAnchors are empty

Hi all,

We use this image as the base builder of a multi-stage dockerfile. Gradle is unable to resolve some dependencies with the error

> Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

It may be something that's out of your control and part of the underlying openjdk:11-jdk image, but figured I'd get the ball rolling by reporting it.

Here's the full stacktrace:

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE.
     Required by:
         project :
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.1.1.RELEASE/spring-boot-gradle-plugin-2.1.1.RELEASE.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.1.1.RELEASE/spring-boot-gradle-plugin-2.1.1.RELEASE.pom'.
               > Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE.
         > Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/2.1.1.RELEASE/spring-boot-gradle-plugin-2.1.1.RELEASE.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/2.1.1.RELEASE/spring-boot-gradle-plugin-2.1.1.RELEASE.pom'.
               > Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
   > Could not resolve net.ltgt.gradle:gradle-apt-plugin:0.19.
     Required by:
         project :
      > Could not resolve net.ltgt.gradle:gradle-apt-plugin:0.19.
         > Could not get resource 'https://repo.maven.apache.org/maven2/net/ltgt/gradle/gradle-apt-plugin/0.19/gradle-apt-plugin-0.19.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/net/ltgt/gradle/gradle-apt-plugin/0.19/gradle-apt-plugin-0.19.pom'.
               > Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve net.ltgt.gradle:gradle-apt-plugin:0.19.
         > Could not get resource 'https://plugins.gradle.org/m2/net/ltgt/gradle/gradle-apt-plugin/0.19/gradle-apt-plugin-0.19.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/net/ltgt/gradle/gradle-apt-plugin/0.19/gradle-apt-plugin-0.19.pom'.
               > Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

compileGroovy fails inside container

Happens with 4.10.x and 5.0.0 version. Something confuses the homedir and therefore the ivy pattern in Grape:

12:35:11     Local Ivy config file 'jar:file:/home/****/workspace/ins_Jenkinsfiles_kubernetes-ST4GFAO45ZKQEETSAJKAWJDJSAVUTX7JW3CXRZAK6ULRFV6F2KFQ/%3F/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.11/444a64af79c540aad257e49d95050e7c189f1309/groovy-all-2.4.11.jar!/groovy/grape/defaultGrapeConfig.xml' appears corrupt - ignoring it and using default config instead
12:35:11     Error was: failed to load settings from jar:file:/home/****/workspace/ins_Jenkinsfiles_kubernetes-ST4GFAO45ZKQEETSAJKAWJDJSAVUTX7JW3CXRZAK6ULRFV6F2KFQ/%3F/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.11/444a64af79c540aad257e49d95050e7c189f1309/groovy-all-2.4.11.jar!/groovy/grape/defaultGrapeConfig.xml: impossible to add configured child for ivy on class org.apache.ivy.plugins.resolver.FileSystemResolver: ivy pattern must be absolute: ?/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
12:35:11        6.530 [id=27]	SEVERE	****.InitReactorRunner$1#onTaskFailed: Failed GrapeHack.hack
12:35:11     java.lang.IllegalArgumentException: ivy pattern must be absolute: ?/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
12:35:11     	at org.apache.ivy.util.Checks.checkAbsolute(Checks.java:57)
12:35:11     	at org.apache.ivy.plugins.resolver.FileSystemResolver.addConfiguredIvy(FileSystemResolver.java:303)
12:35:11     Caused: java.lang.reflect.InvocationTargetException
12:35:11     	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:35:11     	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:35:11     	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:35:11     	at java.lang.reflect.Method.invoke(Method.java:498)
12:35:11     	at org.apache.ivy.util.Configurator.endCreateChild(Configurator.java:708)
12:35:11     Caused: java.lang.IllegalArgumentException: impossible to add configured child for ivy on class org.apache.ivy.plugins.resolver.FileSystemResolver: ivy pattern must be absolute: ?/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
12:35:11     	at org.apache.ivy.util.Configurator.endCreateChild(Configurator.java:712)
12:35:11     	at org.apache.ivy.core.settings.XmlSettingsParser.endElement(XmlSettingsParser.java:596)
12:35:11     	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
12:35:11     	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
12:35:11     	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
12:35:11     	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
12:35:11     	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
12:35:11     	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
12:35:11     	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
12:35:11     	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
12:35:11     	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
12:35:11     	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
12:35:11     	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
12:35:11     	at javax.xml.parsers.SAXParser.parse(SAXParser.java:274)
12:35:11     	at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
12:35:11     Caused: java.text.ParseException: failed to load settings from jar:file:/home/****/workspace/ins_Jenkinsfiles_kubernetes-ST4GFAO45ZKQEETSAJKAWJDJSAVUTX7JW3CXRZAK6ULRFV6F2KFQ/%3F/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.11/444a64af79c540aad257e49d95050e7c189f1309/groovy-all-2.4.11.jar!/groovy/grape/defaultGrapeConfig.xml: impossible to add configured child for ivy on class org.apache.ivy.plugins.resolver.FileSystemResolver: ivy pattern must be absolute: ?/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
12:35:11     	at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:165)
12:35:11     	at org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:150)
12:35:11     	at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:417)
12:35:11     	at org.apache.ivy.core.settings.IvySettings$load.call(Unknown Source)
12:35:11     	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
12:35:11     	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
12:35:11     	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
12:35:11     	at groovy.grape.GrapeIvy.(GrapeIvy.groovy:102)
12:35:11     	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
12:35:11     	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
12:35:11     	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
12:35:11     	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
12:35:11     	at java.lang.Class.newInstance(Class.java:442)
12:35:11     	at groovy.grape.Grape.getInstance(Grape.java:121)
12:35:11     	at org.****ci.plugins.workflow.cps.global.GrapeHack.hack(GrapeHack.java:47)
12:35:11     Caused: java.lang.reflect.InvocationTargetException
12:35:11     	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:35:11     	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:35:11     	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:35:11     	at java.lang.reflect.Method.invoke(Method.java:498)
12:35:11     	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
12:35:11     Caused: java.lang.Error
12:35:11     	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
12:35:11     	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
12:35:11     	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
12:35:11     	at ****.model.Jenkins$5.runTask(Jenkins.java:1069)
12:35:11     	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
12:35:11     	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
12:35:11     	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
12:35:11     	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
12:35:11     	at java.lang.Thread.run(Thread.java:748)

Images for Gradle 4.10.2

The repo seems to be updated with 4.10.2, but I see no relevant tags and images in Docker Hub. It still has 4.10.1 the latest. Any ETA when 4.10.2 will be available? Thanks.

docker gradle build error - Could not create service of type ScriptPluginFactory

Hi,
I am trying to build using docker build command as below. But my command error out as below, not sure what I am missing here. I tried using Jenkins pipeline and from my local in both scenerios, I am getting the same error.

Please let me know what I am missing here...

My build command

docker run --rm -v `pwd`:/usr/src/project -w /usr/src/project {myECRRepo}/gradle:4.7.0-jkd8 gradle -q build

Here is the error

+ docker run --rm -v /var/lib/jenkins/workspace/ervice_feature_containerize-M5AUEJA5HWX4HBZZ5PBVCGIFU3CTBPPVWTXHFW3FSB2ZP4KTS24Q@2:/usr/src/project -w /usr/src/project {{myecrrepo}}/gradle:4.7.0-jkd8 gradle -q build

Welcome to Gradle 4.7!

Here are the highlights of this release:
 - Incremental annotation processing
 - JDK 10 support
 - Grouped non-interactive console logs
 - Failed tests are re-run first for quicker feedback

For more details see https://docs.gradle.org/4.7/release-notes.html


FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

Missing jrunscript file ?

Not sure that is related to your image itself, but:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'elasticsearch.esplugin']
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:156)
        at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:113)
        at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:113)
        at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
        at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:80)
        at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:136)
        at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:44)
        at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34)
        at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
        at build_79twxyt0pbiyfwk3ocuzdct5e.run(/qwant/build.gradle:26)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
        ... 54 more
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/docker-java-home/jre/bin/jrunscript''
        at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:198)
        at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:329)
        at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/docker-java-home/jre/bin/jrunscript'
        at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
        at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
        at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
        ... 2 more
Caused by: java.io.IOException: Cannot run program "/docker-java-home/jre/bin/jrunscript" (in directory "/qwant"): error=2, No such file or directory
        at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
        ... 4 more
Caused by: java.io.IOException: error=2, No such file or directory
        ... 5 more

`git` missing in gradle:jdk11 after move to AdoptOpenJDK

openjdk:11-jdk had git binary bundled, the new adoptopenjdk:11-jdk-hotspot doesn't

Since we use gradle:jdk11 as default image and depends on git binary for our builds we kind of miss it.

Would be great if you could save versions of images on dockerhub so you can pinpoint a specific version.

unable to create docker image with Gradle 4.2.1, gradleSpringBootPluginVersion=2.0.0.RELEASE AND spring cloudVersion=Finchley.M9

Hi ,

I'm trying migrate my application from springboot 1.x to springboot 2.0.0.RELEASE AND spring cloudVersion=Finchley.M9. Docker image is not getting creating with Gradle 4.2.1, gradleSpringBootPluginVersion=2.0.0.RELEASE AND spring cloudVersion=Finchley.M9.

can you please help to trace this issue? Please find below stack trace

applicationname :
Inferred project: parentapplication, version: xxxxx-SNAPSHOT
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_269oudg0suw5gqpkcjl5mme0v.run(//build.gradle:158)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)

Task :applicationname:buildDockerImage
Building image using context '///build'.
Using tag '' for image.

[dockerjava-jaxrs-async-0] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
java.lang.IllegalStateException: InjectionManagerFactory not found.
at org.glassfish.jersey.internal.inject.Injections.lambda$lookupInjectionManagerFactory$0(Injections.java:98)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:98)
at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:68)
at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:432)
at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:341)
at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:826)
at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285)
at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:143)
at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:112)
at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:108)
at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:99)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:456)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:357)
at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:50)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:24)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':applicationname:buildDockerImage'.

InjectionManagerFactory not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

Can't update package list and install openssh

gradle@b4fa1995517a:~$ apt-get update Reading package lists... Done E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

gradle@b4fa1995517a:~$ apt-get install openssh-client E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I try latest, 4.6.0-jdk8, jdk8 images and have the same problem. With 4.6.0-jdk9 image, all work well.
What's happened with jdk8 and latest images or what's I do wrong?

Images for Gradle 4.10.3

Just curious if there is a plan to release 4.10.3 images. Not sure what the followed practice is considering 5.x is out. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.