keeganwitt / docker-gradle

Docker images with Gradle
https://hub.docker.com/_/gradle/
Apache License 2.0
145 stars 73 forks source link

gradle:5.4.1-jdk8-alpine doesn't work with GitLab pipeline #125

Closed daggerok closed 4 years ago

daggerok commented 4 years ago

Hello

My Gitlab pipeline is failing when I'm using gradle:5.4.1-jdk8-alpine image

build frontend ui:
  image: gradle:5.4.1-jdk8-alpine
  stage: build
  cache:
    paths:
      - frontend/.gradle
      - frontend/ui/.npm
      - frontend/ui/node_modules
  script:
    - cd $CI_PROJECT_DIR/frontend
    - ./gradlew npm_install
    - ./gradlew npm_run_build
  artifacts:
    paths:
      - frontend/src/main/resources/public

error:

> Task :npmSetup FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':npmSetup'.
> A problem occurred starting process 'command '/builds/sigmasoftware/dumb-recruiters/frontend/build/nodejs/node-v12.13.1-linux-x64/bin/node''
* 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 2m 8s
2 actionable tasks: 2 executed

I'm using gradle node plugin which should download and install needed nodejs distribution (tasks nodeSetup and npmSetup), and seems like after installing nodejs binaries, these binaries couldn't be found in path on next run. Strange but if I'm using gradle:jdk8 image instead:

build frontend ui:
  image: gradle:jdk8

everything is working as expected. and nodejs binaries can be installed without problems:

> Task :npmSetup
/builds/sigmasoftware/dumb-recruiters/frontend/build/npm/npm-v6.9.0/bin/npm -> /builds/sigmasoftware/dumb-recruiters/frontend/build/npm/npm-v6.9.0/lib/node_modules/npm/bin/npm-cli.js
/builds/sigmasoftware/dumb-recruiters/frontend/build/npm/npm-v6.9.0/bin/npx -> /builds/sigmasoftware/dumb-recruiters/frontend/build/npm/npm-v6.9.0/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.9.0

Updated: found this (maybe) related problem. Can you please also add glibc in your alpine images? Or it's in reality needed only because I'm using gradle node plugin?

Thanks


Regards

daggerok commented 4 years ago

Updates:

just FYI: tested my GitLab pipeline with image adoptopenjdk/openjdk8:x86_64-alpine-jdk8u232-b09-slim and it's working fine.

keeganwitt commented 4 years ago

Alpine uses musl instead of glibc. As I understand it, it is recommended not to use glibc on Alpine. I recommend not Alpine images it if your plugins require glibc.

You'll also notice in other issues in this project, that I moved the images to AdoptOpenJDK instead of OpenJDK, due to some restrictions coming from the official image's compliance with Oracle's wishes. This also resulted in the project no longer offering slim or Alpine images (for now).

daggerok commented 4 years ago

Understand... anyway I got another alpine image working. Meanwhile, will left it here for people who might look same problem:

image


Regards