-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
NIFI-7717 Updated main NiFi images to JRE 11. #4460
Conversation
@MikeThomsen given we support a base of java 8 my perspective here is it makes sense to base images on 8 but allow for 11 rather than basing images on 11 but allowing for 8. Folks can opt in to the newer bits is what I mean. Does this solve something you're facing? My experience, sadly, is that in the wild users are very slow to upgrade their JDK/JRE |
@joewitt @MikeThomsen Can I suggest that this be a build arg in the Dockerfile (they can be used in a FROM) and a property in the pom? That'd make the build pretty flexible and let people twiddle the versions without making changes to the Dockerfile each time. |
@MikeThomsen The Docker maven plugin has a |
c1c1f3f
to
710a384
Compare
@MikeThomsen I'm going to nit on something. This being called That brings up another question. What's the tradeoff between having the base image be completely specified vs. just a tag for the openjdk image? My thinking is:
I think (2) is reasonable motivation. |
@MikeThomsen I wanted to come back to this. I've been using this for a while now and think it'd be helpful to split off the image/repository name, the image tag, and the maintainer as ARGs. For example: ARG IMAGE_NAME=openjdk
ARG IMAGE_TAG=8-jre
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>"
FROM ${IMAGE_NAME}:${IMAGE_TAG} AS artifactbase
LABEL maintainer="${MAINTAINER}"
...
FROM ${IMAGE_NAME}:${IMAGE_TAG}
LABEL maintainer="${MAINTAINER}" And: <properties>
<docker.image.name>openjdk</docker.image.name>
<docker.image.tag>8-jre</docker.image.tag>
<docker.maintainer><![CDATA[Apache NiFi <dev@nifi.apache.org>]]></docker.maintainer>
</properties> What do you think? |
nifi-docker/dockerhub/Dockerfile
Outdated
ARG JAVA_VERSION | ||
FROM ${JAVA_VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG JAVA_VERSION | |
FROM ${JAVA_VERSION} | |
ARG IMAGE_NAME=openjdk | |
ARG IMAGE_TAG=8-jre | |
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>" | |
FROM ${IMAGE_NAME}:${IMAGE_TAG} AS artifactbase |
nifi-docker/dockerhub/Dockerfile
Outdated
|
||
FROM openjdk:8-jre | ||
ARG JAVA_VERSION | ||
FROM ${JAVA_VERSION} | ||
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" | |
LABEL maintainer="${MAINTAINER}" |
nifi-docker/dockerhub/pom.xml
Outdated
@@ -37,6 +41,7 @@ | |||
</goals> | |||
<configuration> | |||
<buildArgs> | |||
<JAVA_VERSION>${docker.java.version}</JAVA_VERSION> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<JAVA_VERSION>${docker.java.version}</JAVA_VERSION> | |
<IMAGE_NAME>${docker.image.name}</IMAGE_NAME > | |
<IMAGE_TAG>${docker.image.tag}</IMAGE_TAG > | |
<MAINTAINER>${docker.maintainer}</MAINTAINER > |
nifi-docker/dockermaven/Dockerfile
Outdated
ARG JAVA_VERSION | ||
FROM $JAVA_VERSION AS artifactbase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG JAVA_VERSION | |
FROM $JAVA_VERSION AS artifactbase | |
ARG IMAGE_NAME=openjdk | |
ARG IMAGE_TAG=8-jre | |
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>" | |
FROM ${IMAGE_NAME}:${IMAGE_TAG} AS artifactbase |
nifi-docker/dockermaven/Dockerfile
Outdated
@@ -16,7 +16,8 @@ | |||
# under the License. | |||
# | |||
|
|||
FROM openjdk:8-jre AS artifactbase | |||
ARG JAVA_VERSION | |||
FROM $JAVA_VERSION AS artifactbase | |||
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" | |
LABEL maintainer="${MAINTAINER}" |
nifi-docker/dockermaven/Dockerfile
Outdated
@@ -53,7 +54,7 @@ RUN mkdir -p ${NIFI_HOME}/conf \ | |||
&& mkdir -p ${NIFI_HOME}/state \ | |||
&& mkdir -p ${NIFI_LOG_DIR} | |||
|
|||
FROM openjdk:8-jre | |||
FROM $JAVA_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM $JAVA_VERSION | |
FROM ${IMAGE_NAME}:${IMAGE_TAG} |
@@ -53,7 +54,7 @@ RUN mkdir -p ${NIFI_HOME}/conf \ | |||
&& mkdir -p ${NIFI_HOME}/state \ | |||
&& mkdir -p ${NIFI_LOG_DIR} | |||
|
|||
FROM openjdk:8-jre | |||
FROM $JAVA_VERSION | |||
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>" | |
LABEL maintainer="${MAINTAINER}" |
@@ -20,6 +20,10 @@ | |||
|
|||
<artifactId>dockerhub</artifactId> | |||
|
|||
<properties> | |||
<docker.java.version>openjdk:8-jre</docker.java.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<docker.java.version>openjdk:8-jre</docker.java.version> | |
<docker.image.name>openjdk</docker.image.name> | |
<docker.image.tag>8-jre</docker.image.tag> | |
<docker.maintainer><![CDATA[Apache NiFi <dev@nifi.apache.org>]]></docker.maintainer> |
@@ -20,6 +20,10 @@ | |||
|
|||
<artifactId>dockermaven</artifactId> | |||
|
|||
<properties> | |||
<docker.java.version>openjdk:8-jre</docker.java.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<docker.java.version>openjdk:8-jre</docker.java.version> | |
<docker.image.name>openjdk</docker.image.name> | |
<docker.image.tag>8-jre</docker.image.tag> | |
<docker.maintainer><![CDATA[Apache NiFi <dev@nifi.apache.org>]]></docker.maintainer> |
nifi-docker/dockermaven/pom.xml
Outdated
@@ -37,6 +41,7 @@ | |||
</goals> | |||
<configuration> | |||
<buildArgs> | |||
<JAVA_VERSION>${docker.java.version}</JAVA_VERSION> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<JAVA_VERSION>${docker.java.version}</JAVA_VERSION> | |
<IMAGE_NAME>${docker.image.name}</IMAGE_NAME > | |
<IMAGE_TAG>${docker.image.tag}</IMAGE_TAG > | |
<MAINTAINER>${docker.maintainer}</MAINTAINER > |
I'll try to take a look at this tonight. Sorry for missing it. |
NIFI-7717 Updated to use build args. NIFI-7717 Fixed a stray reference to jdk 11.
1d54019
to
ac66682
Compare
@jfrazee made the updates. Let me know if they match your expectations. |
@MikeThomsen Hey, I'm +1 on this with one caveat. It looks like LABEL can only use an ARG that's after a FROM. Since it's just moving a line, I can do this on merge unless you object? |
Yeah, go ahead and make the change. |
@MikeThomsen Thanks for this. Was able to build custom image using Java 11 with the following: mvn package -DskipTests -ff -nsu \
-Pdocker \
-Ddocker.image.name=openjdk \
-Ddocker.image.tag=11-jre \
-Ddocker.maintainer='jfrazee@apache.org' |
This closes apache#4460 Signed-off-by: Joey Frazee <jfrazee@apache.org>
This closes apache#4460 Signed-off-by: Joey Frazee <jfrazee@apache.org>
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Enables X functionality; fixes bug NIFI-YYYY.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main
)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squash
or use--force
when pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.