keeganwitt / docker-gradle

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

apt-get update failing on amd64/gradle:7.4.2-jdk17 #224

Closed BoraxTheClean closed 2 years ago

BoraxTheClean commented 2 years ago

I am experiencing this issue on my build nodes, running in a docker-compose environment:

Step 3/18 : RUN apt-get update  && apt-get install -y jq     less     netcat  && apt-get clean -y  && rm -rf /var/lib/apt/lists/*
  | ---> Running in 1dedd901ae9a
  | Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
  | Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
  | Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [4,653 B]
  | Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
  | Get:5 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [156 kB]
  | Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
  | Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [155 kB]
  | Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [71.8 kB]
  | Get:9 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
  | Get:10 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
  | Get:11 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
  | Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1,792 kB]
  | Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [4,653 B]
  | Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [157 kB]
  | Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [268 kB]
  | Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [124 kB]
  | Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [1,202 B]
  | Fetched 21.2 MB in 3s (8,276 kB/s)
  | Reading package lists...
  | E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin \|\| true'
  | E: Sub-process returned an error code
  | The command '/bin/sh -c apt-get update  && apt-get install -y jq     less     netcat  && apt-get clean -y  && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
  | ERROR: Service 'app' failed to build : Build failed 

It is worth noting that I don't experience this same issue when building on my m1 laptop.

BoraxTheClean commented 2 years ago

Downgrading to amd64/gradle:7.4.1-jdk17 resolved this for us. That tag hasn't been pushed to in 2 months.

keeganwitt commented 2 years ago

There appears to have been some issue earlier where Temurin pushed a broken image, that caused a new (also broken) gradle image to be pushed. Can you check if this is still happening? It appears to be fixed now to me.

BoraxTheClean commented 2 years ago

Thanks-I can check on Tuesday.

keeganwitt commented 2 years ago

They recently updated the tag I used as my base image from Focal to Jammy. But I was able to install a package with the current image (Jammy). It's possible it worked on your M1 because of timing differences in the Jenkins builds that push the different architecture images.

egalpin commented 2 years ago

For whichever maintainer hopefully reads this: tags should not be updated like this. If the desire is to back-port prior images to use Jammy, the tag should be incremented or altered (ex. -jammy suffix) so as to leave existing usages undisturbed.

keeganwitt commented 2 years ago

I didn't explicitly make this upgrade. This was built automatically by the Docker Library build system. But I didn't have -focal in my FROM, which maybe I should have.

Is there a need for me to publish both focal and jammy variants? Or is it sufficient to use whatever is the latest eclipse-temurin 8-jdk/11-jdk/17-jdk/etc?

keeganwitt commented 2 years ago

Actually, given all the problems people have been having, I think I will need to publish both a focal and a jammy version until this can all get sorted. out. My plan is the tag without the -focal or -jammy will point to whatever the latest LTS is, and there will be tags for specific LTS versions so you can use those if you need to pin to a particular Ubuntu version.

keeganwitt commented 2 years ago

I'm working on getting -focal variants added: https://github.com/docker-library/official-images/pull/12543.

I didn't anticipate so much trouble coming from Temurin's Ubuntu upgrade. I apologize for the inconvenience.

BoraxTheClean commented 2 years ago

There appears to have been some issue earlier where Temurin pushed a broken image, that caused a new (also broken) gradle image to be pushed. Can you check if this is still happening? It appears to be fixed now to me.

The issue persist for me for the image amd64/gradle:7.4.2-jdk17@sha256:e2c77685fb487b109de4de2e305187d203189572aae56550de2ac3c05a3c4df6.

HugOps ❤️

keeganwitt commented 2 years ago

The Focal images are now available. Let me know if there still issues and I'll reopen this issue.

keeganwitt commented 1 year ago

This issue has come up so frequently (#221, #222, #223, #224, #226, #227, #230, #231), I've created a page explaining: https://github.com/keeganwitt/docker-gradle/wiki/Troubleshooting:-JAVA_HOME-is-set-to-an-invalid-directory. Please let me know how the page can be improved.