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

restserver docker image: set jdk17 for all platforms #1713

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

jberggg
Copy link

@jberggg jberggg commented Aug 23, 2022

This is an attempt to fix #1712. First tests seem to be ok, no crashes anymore. However I will keep using the image for the next few hours, upload some new data and see whether I encounter any issues. Will report back. In the meantime: I made some changes to the image:

  • set openjdk17 for all platforms because it is a LT supported jre/jdk version and works with Scala 3.2.18
  • use curl for downloading the app .zip because I had troubles building the image, wget failed during build process. I guess that it doesn't follow redirects because I first had the same issue with curl but with the -L flag it worked
  • update alpine version, however I think we could even use the 3 tag so that we always get the newest minor version, what do you think?

If you like I can also adjust the joex image description with the same changes.

... and last but not least, thank you for that awesome webapp 🥳

@jberggg
Copy link
Author

jberggg commented Aug 23, 2022

btw, I only tested for arm64 because this is my installation. Would appreciate if someone else could test amd64.

@eikek
Copy link
Owner

eikek commented Aug 23, 2022

I can quickly test amd64 tomorrow, thank you!! Joex is a bit more involved because it requires more tools to be available. The biggest hurdle is that wkhtmltopdf is not available anymore on alpine > 3.14 (afaik). We could use the drop-in replacement weasyprint, though. I did some tests a while ago and found wkhtmltopdf still a bit better - but don't see other options. Maybe only basing on a different distribution, like ubuntu (which increases image size).

@eikek
Copy link
Owner

eikek commented Aug 23, 2022

Oh and docspell still uses scala 2.13 :-) but I guess jdk17 is fine. We could also just change it for the arm images, if we want to be less "drastic" :) but I don't care much.

@jberggg
Copy link
Author

jberggg commented Aug 23, 2022

Yay, would be great if you could test amd64.

Okay I see regarding the wkhtmltopdf and joex. Maybe we could manually install it from binary or so? If you want I can also do some reasearch there. I prefer alpine or slim images, bigger images like ubuntu etc. have many drawbacks like bigger attack surface, longer loading times, more space usage etc. I would vote for to keeping your current approach with alpine.

Uff, messed up the numbers, I mean 2.13.8 😂 The compatibilty guide says:

JDK 17 is an LTS release.
Scala 2.13.6 and 2.12.15 support JDK 17.

So 2.13.8 should be fine as well. But it's your project so totally up to you, I'm happy either way.

@eikek
Copy link
Owner

eikek commented Aug 26, 2022

I'm fine with updating it on all architectures. 👍🏼

@eikek eikek merged commit 7c0f9d0 into eikek:master Aug 26, 2022
@eikek
Copy link
Owner

eikek commented Aug 26, 2022

Sadly it looks like there is no openjdk17 package for armv7 (that I did not test :)) Only openjdk8 is available. Maybe we need to drop support for armv7 or consider different base distribution.

  > [linux/arm/v7 2/4] RUN apk update &&     apk add --no-cache openjdk17-jre bash tzdata curl &&     apk add 'zlib=1.2.12-r3':
#0 0.249 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/armv7/APKINDEX.tar.gz
#0 1.287 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/armv7/APKINDEX.tar.gz
#0 3.630 v3.16.2-101-g5201df137e [https://dl-cdn.alpinelinux.org/alpine/v3.16/main]
#0 3.632 v3.16.2-105-g93db4443dc [https://dl-cdn.alpinelinux.org/alpine/v3.16/community]
#0 3.632 OK: 16554 distinct packages available
#0 3.940 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/armv7/APKINDEX.tar.gz
#0 4.728 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/armv7/APKINDEX.tar.gz
#0 6.370 ERROR: unable to select packages:
#0 6.522   openjdk17-jre (no such package):
#0 6.522     required by: world[openjdk17-jre]
------
restserver.dockerfile:7
--------------------
   6 |     
   7 | >>> RUN apk update && \
   8 | >>>     apk add --no-cache openjdk17-jre bash tzdata curl && \
   9 | >>>     apk add 'zlib=1.2.12-r3'
  10 |     
--------------------

@jberggg
Copy link
Author

jberggg commented Aug 26, 2022

Just saw the error, argh... 😢 Haven't tested armv7 either.

Does docker hub tells you if there is someone pulling armv7 images? If not then you could just remove it and think about a solution once someone or enough people request support for armv7. If someone or enough people are actually pulling the latest version and latest tag then yes we could think about using a different base image for that particular architecture. I can support you with making another PR if you want/need to handle armv7 and want help.

@eikek
Copy link
Owner

eikek commented Aug 26, 2022

Docker hub doesn't tell me how many/often it is downloaded, only the latest download was a month ago. There are some people probably using it, but not many I would assume. We could also use a different base distribution for arm only - but all this docker maintenance goes pretty wild then… :) I think I just drop it, if people need it they can build images themselves. Thanks for your help offering! That is much appreciated! I'm still thinking about what way to go :-)

@jberggg
Copy link
Author

jberggg commented Aug 26, 2022

Yes, different base distribution for armv7 only was my idea / how I understood you.

I think the maintenance is not that bad. Of course the initial effort to evaluate a compatible distribution and writing the Dockerfile but from there on - if it is possible to choose a tag that pins down the Major-Version of the Image OS instead of the Minor-Version - the maintenance should be pretty low.

And the people that run that special image could also put in some effort, like I did 😄 Speaking of it, one way to go could be to drop support for now and plan to create an image description later. If someone wants to have it faster he/she could put in the effort and come up with one.

@jberggg
Copy link
Author

jberggg commented Aug 26, 2022

ah just read that ubuntu has a minimal container-optimized image that is only 29MB in size. Wasn't aware of that and that's why you probably mentioned it. So that would be an alternative to Alpine indeed.

Edit: But then again Debian has its stable-slim version which is same size and alpine's image size is 3MB and probably less packages installed overall. I think I would dig deeper than just a shallow Google search to come up with an alternative.

@eikek
Copy link
Owner

eikek commented Aug 26, 2022

Yes you understood correctly :-) I was also thinking loud a little. The docker images are a bit of work to me I have to admit. I'm not a docker expert (or Linux Distro…). Every now and then a package breaks or is gone - I think dropping armv7 is fine for now. It reduces complexity a lot (to me at least).

I also tried once the debian-slim images, they are not bad. But after installing required packages it gets much larger than the alpine one. I suppose it has more dependent packages installed (it was worse for joex than restserver iirc). Probably one can put in more effort and bring it down - but I wouldn't bother - it's precious free time wasted for a few megabytes 😄

eikek added a commit that referenced this pull request Aug 26, 2022
See PR #1713, if support is wanted, please open an issue or better a
PR ;-).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restserver docker image issues - NoSuchFieldError: EPOCH
2 participants