Skip to content

Commit c2d4c4e

Browse files
Yikungengliangwang
authored andcommitted
[SPARK-40256][BUILD][K8S] Switch base image from openjdk to eclipse-temurin
### What changes were proposed in this pull request? This PR switchs the base image from [`openjdk`](https://hub.docker.com/_/openjdk) to [`eclipse-temurin`](https://hub.docker.com/_/eclipse-temurin) (original openjdk). The core change is: the OS of base image changes `debian-bullseye` to `ubuntu-focal` (based on debian bullseye). ### Why are the changes needed? - According to docker-library/openjdk#505 and docker-library/docs#2162, openjdk:8/11 image is EOL and Eclipse Temurin replaces this, the original openjdk image will `remove the 11 and 8 tags (in October 2022, perhaps)` (we are using it in spark), so we have to switch this before it happens. - The `openjdk` is [not update anymore](https://adoptopenjdk.net/upstream.html) (the last releases were 8u342 and 11.0.16, Eclipse Temurin replace is recommanded by adoptopenjdk) that means even the 8/11 tag is not removed, we still need to switch `openjdk`. - There were [many docker official image](https://github.com/search?q=org%3Adocker-library+temurin&type=code) already switch openjdk to eclipse-temurin. - According the [jvm ecosystem report](https://snyk.io/jvm-ecosystem-report-2021) from docker-library/docs#2162 , AdoptOpenJDK(now donation to eclipse foundation and rename to eclipse temurin) builds of OpenJDK most popular in production. - An ideal long-term solution is that we only choose the jdk version and leave the adaptation of OS to the corresponding openjdk official image (just like eclipse-temurin are suppoort [ubuntu, alpine, centos](https://github.com/adoptium/containers/tree/main/11/jre)) - The alternate solution is we just swith `openjdk` image to `debian-bullseye` with openjdk 11 installation. like: Yikun#163. But it makes spark image **depends on debian OS more**, that means we will diffcult to support the Java version which debian OS doesn't support (such as openjdk-8-jre is not be supported in current debian anymore). For the above reason, I think `eclipse-temurin` is a good choice. ### Does this PR introduce _any_ user-facing change? Yes, the docker images base image changes. ### How was this patch tested? CI passed, I also have a local test on: Yikun#162 Closes #37705 from Yikun/switch-temurin. Authored-by: Yikun Jiang <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
1 parent 296fe49 commit c2d4c4e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

bin/docker-image-tool.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ Examples:
269269
$0 -r docker.io/myrepo -t v2.3.0 push
270270
271271
- Build and push Java11-based image with tag "v3.0.0" to docker.io/myrepo
272-
$0 -r docker.io/myrepo -t v3.0.0 -b java_image_tag=11-jre-slim build
272+
$0 -r docker.io/myrepo -t v3.0.0 -b java_image_tag=11-jre-focal build
273273
$0 -r docker.io/myrepo -t v3.0.0 push
274274
275275
- Build and push Java11-based image for multiple archs to docker.io/myrepo
276-
$0 -r docker.io/myrepo -t v3.0.0 -X -b java_image_tag=11-jre-slim build
276+
$0 -r docker.io/myrepo -t v3.0.0 -X -b java_image_tag=11-jre-focal build
277277
# Note: buildx, which does cross building, needs to do the push during build
278278
# So there is no separate push step with -X
279279

resource-managers/kubernetes/docker/src/main/dockerfiles/spark/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
ARG java_image_tag=11-jre-slim
17+
ARG java_image_tag=11-jre-focal
1818

19-
FROM openjdk:${java_image_tag}
19+
FROM eclipse-temurin:${java_image_tag}
2020

2121
ARG spark_uid=185
2222

@@ -28,7 +28,6 @@ ARG spark_uid=185
2828
# docker build -t spark:latest -f kubernetes/dockerfiles/spark/Dockerfile .
2929

3030
RUN set -ex && \
31-
sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list && \
3231
apt-get update && \
3332
ln -s /lib /lib64 && \
3433
apt install -y bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools && \

resource-managers/kubernetes/integration-tests/scripts/setup-integration-test-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ then
103103
cd $SPARK_INPUT_DIR
104104

105105
if [[ $DOCKER_FILE == "N/A" ]]; then
106-
# OpenJDK base-image tag (e.g. 8-jre-slim, 11-jre-slim)
106+
# OpenJDK base-image tag (e.g. 8-jre-focal, 11-jre-focal)
107107
JAVA_IMAGE_TAG_BUILD_ARG="-b java_image_tag=$JAVA_IMAGE_TAG"
108108
else
109109
if [[ $DOCKER_FILE = /* ]]; then

0 commit comments

Comments
 (0)