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

Add Java 17 Alpine #222

Merged
merged 3 commits into from
Dec 9, 2021
Merged

Add Java 17 Alpine #222

merged 3 commits into from
Dec 9, 2021

Conversation

bob-rohan
Copy link
Contributor

@bob-rohan bob-rohan commented Dec 9, 2021

adding jdk17 for alpine

tests performed locally

  • make test-alpine_jdk17
  • java -version
$ docker run jenkins/agent:alpine-jdk17 java -version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-alpine-r0)
OpenJDK 64-Bit Server VM (build 17.0.1+12-alpine-r0, mixed mode)

Fixes #221

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@bob-rohan bob-rohan requested a review from a team as a code owner December 9, 2021 12:02
RUN jlink \
--module-path /usr/lib/jvm/default-jvm/jmods \
--add-modules ALL-MODULE-PATH \
--strip-java-debug-attributes \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alpine jdk11 used --strip-debug, which caused the following error with jdk17

Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory

So replaced --strip-debug with --strip-java-debug-attributes as described here

Copy link
Member

Choose a reason for hiding this comment

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

yeah we hit that somewhere else too

docker-bake.hcl Outdated
Comment on lines 112 to 113
"${REGISTRY}/${JENKINS_REPO}:alpine-jdk17",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17",
Copy link
Member

@timja timja Dec 9, 2021

Choose a reason for hiding this comment

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

can you include preview in the tag like debian as we don't officially support it yet.

Suggested change
"${REGISTRY}/${JENKINS_REPO}:alpine-jdk17",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17",
"${REGISTRY}/${JENKINS_REPO}:alpine-jdk17-preview",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17-preview",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@timja timja changed the title #221 add jdk17 alpine Add Java 17 Alpine Dec 9, 2021
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Optional change of comment suggested, though it can also be done as a later step in another pull request that changes all the Dockerfile's with that comment.


RUN addgroup -g ${gid} ${group}
RUN adduser -h /home/${user} -u ${uid} -G ${group} -D ${user}
LABEL Description="This is a base image, which provides the Jenkins agent executable (slave.jar)" Vendor="Jenkins project" Version="${VERSION}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that it is now named agent.jar, isn't it?

Suggested change
LABEL Description="This is a base image, which provides the Jenkins agent executable (slave.jar)" Vendor="Jenkins project" Version="${VERSION}"
LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@timja timja enabled auto-merge (squash) December 9, 2021 14:44
@timja timja merged commit defb878 into jenkinsci:master Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add jdk17 for alpine
3 participants