Skip to content

Comments

PP-8475 Dockerfile#7

Merged
mrlumbu merged 1 commit intomainfrom
PP-8475-docker-build
Sep 30, 2021
Merged

PP-8475 Dockerfile#7
mrlumbu merged 1 commit intomainfrom
PP-8475-docker-build

Conversation

@mrlumbu
Copy link
Contributor

@mrlumbu mrlumbu commented Sep 24, 2021

Dockerfile added same as other java apps.

Have used standard docker startup script, but commented out
wait on dependencies bit until we have some dependencies.

Moved config to the right place so that it is included
in target.

Added dependabot file to keep base image up to date.

mvn clean package
docker build . -t webhooks
docker run -e JAVA_OPTS='-Xms128m -Xmx1G' -it webhooks

@katstevens
Copy link
Contributor

Swinging by to suggest enabling Dependabot updates for this base image, if this isn't on your radar already (so it doesn't get forgotten later). Something like this example?

@mrlumbu mrlumbu force-pushed the PP-8475-docker-build branch from 5b97e24 to 8d6e386 Compare September 30, 2021 08:26
Dockerfile added same as other java apps.

Have used standard docker startup script, but commented out
wait on dependencies bit until we have some dependencies.

Moved config to the right place so that it is included
in target.

Added dependabot file to keep base image up to date.
@@ -0,0 +1,29 @@
FROM openjdk:17-jdk-alpine@sha256:a996cdcc040704ec6badaf5fecf1e144c096e00231a29188596c784bcf858d05
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite the same as we use in our other Java apps (apart from the obvious Java 17 v Java 11 difference).

We currently use Docker images provided by the Adoptium (formerly AdoptOpenJDK) project that use Alpine Linux as the operating system. Since Alpine works with musl rather than glibc, they toss in the alpine-pkg-glibc glibc compatibility layer and then include the standard glibc-based Linux build of the Eclipse Temurin (formerly AdoptOpenJDK) JRE.

I should note that while our Java apps have used this configuration for a long time, the Alpine Linux maintainers would disagree. They consider the glibc compatibility layer to be so dangerous that they’ve considered making changes to Alpine Linux to stop it from working with alpine-pkg-glibc. Their disapproval is having effects: Adoptium will not be making Alpine images for Java 17 that use alpine-pkg-glibc and there will not be official Alpine OpenJDK images that use alpine-pkg-glibc either.

What this PR uses is an official OpenJDK Docker image that uses Alpine Linux as the operating system and a native musl-based Alpine Linux port of OpenJDK (developed under the name Project Portola) (not a JRE). The Alpine Linux OpenJDK port is not currently considered to be production ready.

That said, I think it’s fine to use for now. We can always re-evaluate later.

There’s also the JDK versus JRE difference. Since Java 11, the JRE has not really been a thing but the AdoptOpenJDK project continued to produce JRE binaries and images. Adoptium will only produce Temurin JDK (and not JRE) builds for Java 17 and above) so at some point we’re going to have to deal with this change (and maybe look into the suggested alternative of using jlink).

@mrlumbu mrlumbu merged commit 96283ad into main Sep 30, 2021
@mrlumbu mrlumbu deleted the PP-8475-docker-build branch September 30, 2021 10:58
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.

3 participants