Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile build is broken #260

Closed
vorburger opened this issue Oct 29, 2021 · 5 comments
Closed

Dockerfile build is broken #260

vorburger opened this issue Oct 29, 2021 · 5 comments

Comments

@vorburger
Copy link
Member

#259 is blocked by https://github.com/OASIS-learn-study/minecraft-storeys-maker/blob/develop/Dockerfile failing (for me) with:

Downloading https://services.gradle.org/distributions/gradle-6.8.2-bin.zip
......................................................................................................

Welcome to Gradle 6.8.2!

Here are the highlights of this release:
 - Faster Kotlin DSL script compilation
 - Vendor selection for Java toolchains
 - Convenient execution of tasks in composite builds
 - Consistent dependency resolution

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

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '/project/scratch3/build.gradle' line: 23

* What went wrong:
A problem occurred evaluating project ':scratch3'.
> Cannot invoke method clone() on null object

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 22s
The command '/bin/sh -c ./gradlew build -x test' returned a non-zero code: 1

Probably some Java/Gradle version problem in the Dockerfile? @edewit says it work locally for him - let's figure out how to fix this...

@edewit
Copy link
Member

edewit commented Oct 29, 2021

this clone method comes from a gradle plugin (org.ajoberstar.grgit), could it be that it's not allowed on google cloud?

@vorburger
Copy link
Member Author

I can't reproduce the problem when running ./gradlew build -x test "manually & locally" (specifically in a Google Cloud Shell, where it took a full 9 minutes, wow).

I do however see the exact same error as above when running podman build . on my Fedora 34 Workstation, so it must be something specific to the Dockerfile / container environment? Curious that it works for @edewit ... probably something locally cached?

this clone method comes from a gradle plugin (org.ajoberstar.grgit), could it be that it's not allowed on google cloud?

Aha! I stupidely assumed that somehow hasd something to do with a Gradle problem with https://en.wikipedia.org/wiki/Clone_(Java_method) ... thanks for pointing out that this is the grgit.clone(dir: dest, uri: "https://github.com/edewit/${dir}.git") in https://github.com/OASIS-learn-study/minecraft-storeys-maker/blob/develop/scratch3/build.gradle#L23 that's failing here! Yeah, somehow that must not work in containers. (But apparently no specifically on Google Cloud only.)

I do have an idea how to get to the bottom of it - I'll toy locally with increasing the gradle log level in the Dockerfile; I'll post what I see here in a moment.

vorburger added a commit that referenced this issue Oct 29, 2021
Just for now - maybe we'll add it back later again - see #260 & #261.
@vorburger
Copy link
Member Author

Hah, docker build . also worked in a Google Cloud Shell - where I coincidentially have just manually locally removed .dockerignore to try out an idea for #261. And running it in Podman on Fedora with ./gradlew --stacktrace --debug ... added in the Dockerfile shows:

Failed trying to find git repository for :scratch3
java.lang.IllegalStateException: No .git directory found

So yeah it's related to the .dockerignore filtering out the .git. I propose we do 2 things:

  1. for the very short term to unblock, let's just kill the .dockerignore, as proposed in rm .dockerignore #262 - merge?
  2. let's keep this issue open, maybe we (you?) can a way to make that grgit.clone work even when there is no .git/?

edewit pushed a commit that referenced this issue Oct 29, 2021
Just for now - maybe we'll add it back later again - see #260 & #261.
@edewit
Copy link
Member

edewit commented Oct 29, 2021

Yes working on 2. now let's use a binary version we download instead of building these forks here.

@vorburger
Copy link
Member Author

I'm closing this now that #266 which addresses 2. has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants