carlossg / docker-maven

Official Docker image with Maven
Apache License 2.0
524 stars 423 forks source link

Adding corretto-maven images based on Debian #346

Closed anirbanmu closed 1 year ago

anirbanmu commented 1 year ago

Hi there,

Before I attempt to make PRs etc.. I wanted to discuss with you whether you'd be open to having Corretto images with maven that are based on Debian stable?

If you are open to this, even though upstream Corretto images don't have a Debian variant -- I think it'd be very simple to have this sort of image for this repo since https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/generic-linux-install.html provides a Debian apt repo to install Corretto.

anirbanmu commented 1 year ago

For context -- at Slack we are using something similar to the addition I'm proposing and we'd like to contribute it back here for general availability.

carlossg commented 1 year ago

hi, isn't amazon willing to provide a corretto debian variant? Putting it here may be ok, but it adds extra maintenance and it is possible that it cannot be published to the official dockerhub registry, just my personal ones, would need to check with Dockerhub maintainers.

anirbanmu commented 1 year ago

Thank you for the quick response. That's a good question -- I asked here whether there's plans to publish the Debian based corretto images & if so whether they can be updated to track debian:stable-slim rather than debian:buster-slim -- https://github.com/corretto/corretto-docker/issues/140.

Putting this here for the case that they do not want to provide a Debian based Corretto image:

RUN apt-get update \ && apt-get dist-upgrade -y \ && apt-get install curl gnupg -y \ && apt-get autoremove -y \ && curl https://apt.corretto.aws/corretto.key | gpg --dearmor | dd of=/usr/share/keyrings/corretto.gpg \ && echo "deb [signed-by=/usr/share/keyrings/corretto.gpg] https://apt.corretto.aws stable main" > /etc/apt/sources.list.d/corretto.list \ && apt-get update \ && apt-get install -y java-17-amazon-corretto-jdk \ && rm -rf /var/lib/apt/lists/*

common for all images

``` - As for not being able to publish such an image to the official dockerhub registry -- would a Maven image that was based on Amazon published Debian corretto (if they were to provide one) be allowed to official dockerhub registry easier? Just trying to confirm my understanding that the barrier to publishing to official dockerhub registry is having the Corretto install in this repo and not Debian in general.
carlossg commented 1 year ago

I think this can be added here, then it will be submitted to the dockerhub maintainers and see if it is accepted

anirbanmu commented 1 year ago

Sounds good, I will make a PR in the coming days then.

anirbanmu commented 1 year ago

@carlossg wanted to ask about some of the comments in https://github.com/docker-library/official-images/pull/14308#issuecomment-1496758237

To address the naming & not pinning to a particular debian release, what is your opinion on doing the following -

I would love to get the debian images in a state that is acceptable to official dockerhub maintainers so let me know what your thoughts are here & I am happy to do the changes that you suggest.

carlossg commented 1 year ago

IIUC that comment the concern is that there are eclipse-temurin-11-focal and these should be amazoncorretto-11-bullseye or amazoncorretto-11-debian (for stable) or amazoncorretto-11-buster (is buster the current stable?)

the architectures can be filtered in https://github.com/carlossg/docker-maven/blob/main/generate-stackbrew-library.sh#L36-L41

anirbanmu commented 1 year ago

Current debian stable is bullseye. IMO at least for now, let's just rename to amazoncorretto-11-debian and inherit from debian:bullseye-slim.

I think renaming the directories to include the release name is IMO going to be more maintenance overhead (because we'll need to regenerate all the workflow .ymls, change any checks for them etc.) when stable release rolls over; we can just add an extra tag for the release name as a suffix instead so people can pin to that if they want to.

If you are OK with my proposal, I can make a PR to do that & also filter the architectures in the same PR.

anirbanmu commented 1 year ago

Have gone ahead and made a PR which attempts to address the naming -- https://github.com/carlossg/docker-maven/pull/362

anirbanmu commented 1 year ago

Just wanted to say thank you much @carlossg for all the time and effort you've spent getting the Debian images onto docker hub! It's much appreciated. With that I will go ahead and close this issue!