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

chore: jlink improvements from jenkinsci/docker #799

Conversation

lemeurherve
Copy link
Member

This PR integrates jlink improvement from jenkinsci/docker#1857.

adapted it to be POSIX compliant as the Alpine ash shell doesn't support arrays

Notes:

  • I removed the TARGETPLATFORM check in Alpine images as we're not publishing any arm/v7 image of this kind.
  • The Debian "preview" Dockerfile doesn't need these changes as it's used to build only one JDK (21).

Extracted from:

Testing done

Local builds + CI

Submitter checklist

@lemeurherve lemeurherve force-pushed the improve-jlink-like-in-jenkinsci-docker branch from 783aab6 to 226dbd4 Compare May 6, 2024 22:55
lemeurherve added a commit to lemeurherve/docker-agent that referenced this pull request May 6, 2024
@MarkEWaite MarkEWaite merged commit a172d06 into jenkinsci:master May 7, 2024
10 checks passed
@lemeurherve lemeurherve deleted the improve-jlink-like-in-jenkinsci-docker branch May 7, 2024 06:31
@dduportal
Copy link
Contributor

I removed the TARGETPLATFORM check in Alpine images as we're not publishing any arm/v7 image of this kind.

That assertion is false as per

platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x", "linux/ppc64le"]

We do publish arm/v7 images for the agents. However, the builds seems to have passed!
Anyone with a 32 bits ARM to test (ping @gounthar as you have my Rpis ;) ) the resulting image? It would be really a good news if no need for this if anymore \o/

@gounthar
Copy link
Contributor

gounthar commented May 7, 2024

The following tags are working for me on armv7:

  • agent
  • latest-jdk17
  • latest-bookworm-jdk17
  • latest-bookworm
  • latest-jdk11
  • latest-bookworm-jdk11
  • jdk17
  • jdk11
  • latest-jdk21-preview
  • bookworm-jdk17
  • bookworm-jdk11
  • latest-bookworm-jdk21-preview
  • jdk21-preview
  • 3206.vb_15dcf73f6a_9-10

@dduportal let me know if I should send back your Pis soon. 😉

@lemeurherve
Copy link
Member Author

lemeurherve commented May 7, 2024

I removed the TARGETPLATFORM check in Alpine images as we're not publishing any arm/v7 image of this kind.

That assertion is false as per

platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x", "linux/ppc64le"]

We do publish arm/v7 images for the agents. However, the builds seems to have passed! Anyone with a 32 bits ARM to test (ping @gounthar as you have my Rpis ;) ) the resulting image? It would be really a good news if no need for this if anymore \o/

@dduportal This line concerns debian images, not the Alpine one, AFAICT the assertion is true:

None of the Alpine images specify arm/v7 architecture:

platforms = ["linux/amd64"]
}
target "alpine_jdk17" {
matrix = {
type = ["agent", "inbound-agent"]
}
name = "${type}_alpine_jdk17"
target = type
dockerfile = "alpine/Dockerfile"
context = "."
args = {
ALPINE_TAG = ALPINE_FULL_TAG
JAVA_VERSION = JAVA17_VERSION
VERSION = REMOTING_VERSION
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk17" : "",
"${REGISTRY}/${orgrepo(type)}:alpine",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}",
"${REGISTRY}/${orgrepo(type)}:alpine-jdk17",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}-jdk17",
"${REGISTRY}/${orgrepo(type)}:latest-alpine",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}",
"${REGISTRY}/${orgrepo(type)}:latest-alpine-jdk17",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}-jdk17",
]
platforms = ["linux/amd64"]
}
target "alpine_jdk21" {
matrix = {
type = ["agent", "inbound-agent"]
}
name = "${type}_alpine_jdk21"
target = type
dockerfile = "alpine/Dockerfile"
context = "."
args = {
ALPINE_TAG = ALPINE_FULL_TAG
JAVA_VERSION = JAVA21_VERSION
VERSION = REMOTING_VERSION
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk21" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk21" : "",
"${REGISTRY}/${orgrepo(type)}:alpine-jdk21",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}-jdk21",
"${REGISTRY}/${orgrepo(type)}:latest-alpine-jdk21",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}-jdk21",
]
platforms = ["linux/amd64", "linux/arm64"]

@dduportal
Copy link
Contributor

I removed the TARGETPLATFORM check in Alpine images as we're not publishing any arm/v7 image of this kind.

That assertion is false as per

platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x", "linux/ppc64le"]

We do publish arm/v7 images for the agents. However, the builds seems to have passed! Anyone with a 32 bits ARM to test (ping @gounthar as you have my Rpis ;) ) the resulting image? It would be really a good news if no need for this if anymore \o/

@dduportal This line concerns debian images, not the Alpine one.

None of the Alpine images specify arm/v7 architecture, AFAICT the assertion is true:

platforms = ["linux/amd64"]
}
target "alpine_jdk17" {
matrix = {
type = ["agent", "inbound-agent"]
}
name = "${type}_alpine_jdk17"
target = type
dockerfile = "alpine/Dockerfile"
context = "."
args = {
ALPINE_TAG = ALPINE_FULL_TAG
JAVA_VERSION = JAVA17_VERSION
VERSION = REMOTING_VERSION
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk17" : "",
"${REGISTRY}/${orgrepo(type)}:alpine",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}",
"${REGISTRY}/${orgrepo(type)}:alpine-jdk17",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}-jdk17",
"${REGISTRY}/${orgrepo(type)}:latest-alpine",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}",
"${REGISTRY}/${orgrepo(type)}:latest-alpine-jdk17",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}-jdk17",
]
platforms = ["linux/amd64"]
}
target "alpine_jdk21" {
matrix = {
type = ["agent", "inbound-agent"]
}
name = "${type}_alpine_jdk21"
target = type
dockerfile = "alpine/Dockerfile"
context = "."
args = {
ALPINE_TAG = ALPINE_FULL_TAG
JAVA_VERSION = JAVA21_VERSION
VERSION = REMOTING_VERSION
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk21" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk21" : "",
"${REGISTRY}/${orgrepo(type)}:alpine-jdk21",
"${REGISTRY}/${orgrepo(type)}:alpine${ALPINE_SHORT_TAG}-jdk21",
"${REGISTRY}/${orgrepo(type)}:latest-alpine-jdk21",
"${REGISTRY}/${orgrepo(type)}:latest-alpine${ALPINE_SHORT_TAG}-jdk21",
]
platforms = ["linux/amd64", "linux/arm64"]

🤦 I missed the `Alpine£ word in the original sentence. my apologies.

@dduportal
Copy link
Contributor

@dduportal let me know if I should send back your Pis soon. 😉

Thanks for taking some time. The goal was to test the unreleased version but as underlined by Hervé above I was misguided: there are no arm/v7 Alpine (I mistook with Debian).

@gounthar
Copy link
Contributor

gounthar commented May 7, 2024

My bad, I misunderstood the request. 🤷

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.

4 participants