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
feat(alpine): Pin Alpine version to 3.17.3 #252
Conversation
Defines `ALPINE_SHORT_TAG` and `ALPINE_FULL_TAG`, and uses it when tagging the various Alpine images.
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.
It looks really good work!
About the CI checks:
- The build passes: your local test matches with what the Ci does ✅
- The tests are failing for both
alpine
andalpine_jdk17
images with the error below ❌
[docker.io/jenkins/ssh-agent:alpine] has utf-8 locale
[docker.io/jenkins/ssh-agent:alpine_jdk17] has utf-8 locale
which measn there was some setup in the former eclipse-temuring
we should cherry-pick (or maybe from toher jenkinsci/docker-* Alpine images). Almost there!
I believe you should be able to "test" locally with Line 75 in 8616460
|
You were right Damien, the command that launched the test was The local error message is: not ok 11 [docker.io/jenkins/ssh-agent:alpine-jdk17] has utf-8 locale
# (from function `assert_equal' in file tests/test_helper/bats-assert/src/assert_equal.bash, line 40,
# in test file tests/tests.bats, line 188)
# `assert_equal "${output}" "UTF-8"' failed
#
# -- values do not equal --
# expected : UTF-8
# actual : sh: locale: not found
# --
# I'll try to find a workaround (or the solution) in Temurin's Dockerfile or docker-agent's Dockerfile. Thanks. |
I added the not ok 3 [docker.io/jenkins/ssh-agent:alpine-jdk17] image has bash and java installed and in the PATH
# (from function `assert_success' in file tests/test_helper/bats-assert/src/assert_success.bash, line 42,
# in test file tests/tests.bats, line 43)
# `assert_success' failed
# adb1ded4913ac98bdfb1b3cb51c3eab030dcd2781516719737064d902572ae04
#
# -- command failed --
# status : 1
# output : Error response from daemon: No such container: bats-jenkins-ssh-agent-bash-java
# --
#
docker run --rm jenkins/ssh-agent:alpine-jdk17 java --version
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
+ env
+ grep _
+ [[ 2 -gt 0 ]]
+ echo 'setup-sshd params: java' --version
+ [[ java == ssh-* ]]
+ [[ java --version == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''java' '--version'\'''
+ exec java --version
setup-sshd params: java --version
Executing params: 'java --version'
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode)
docker run --rm jenkins/ssh-agent:alpine-jdk17 /bin/bash -c 'echo "Hello, world!"'
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
+ env
+ grep _
+ [[ 3 -gt 0 ]]
+ echo 'setup-sshd params: /bin/bash' -c 'echo "Hello, world!"'
+ [[ /bin/bash == ssh-* ]]
+ [[ /bin/bash -c echo "Hello, world!" == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''/bin/bash' -c 'echo "Hello, world!"'\'''
+ exec /bin/bash -c 'echo "Hello, world!"'
setup-sshd params: /bin/bash -c echo "Hello, world!"
Executing params: '/bin/bash -c echo "Hello, world!"'
Hello, world! 🤔 |
I had a look at the tests, and launched the same commands that went fine: docker run --rm jenkins/ssh-agent:alpine-jdk17 which bash
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
+ env
+ grep _
setup-sshd params: which bash
Executing params: 'which bash'
+ [[ 2 -gt 0 ]]
+ echo 'setup-sshd params: which' bash
+ [[ which == ssh-* ]]
+ [[ which bash == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''which' 'bash'\'''
+ exec which bash
/bin/bash
gounthar@his-machine:/mnt/c/Support/users/jenkins/git/ci/docker-ssh-agent (alpine-multi-stage)$ docker run --rm jenkins/ssh-agent:alpine-jdk17 bash --version
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
+ env
+ grep _
setup-sshd params: bash --version
Executing params: 'bash --version'
+ [[ 2 -gt 0 ]]
+ echo 'setup-sshd params: bash' --version
+ [[ bash == ssh-* ]]
+ [[ bash --version == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''bash' '--version'\'''
+ exec bash --version
GNU bash, version 5.2.15(1)-release (x86_64-alpine-linux-musl)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gounthar@his-machine:/mnt/c/Support/users/jenkins/git/ci/docker-ssh-agent (alpine-multi-stage)$ docker run --rm jenkins/ssh-agent:alpine-jdk17 which java
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
+ env
+ grep _
+ [[ 2 -gt 0 ]]
+ echo 'setup-sshd params: which' java
+ [[ which == ssh-* ]]
+ [[ which java == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''which' 'java'\'''
+ exec which java
setup-sshd params: which java
Executing params: 'which java'
/opt/java/openjdk/bin/java
gounthar@his-machine:/mnt/c/Support/users/jenkins/git/ci/docker-ssh-agent (alpine-multi-stage)$ docker run --rm jenkins/ssh-agent:alpine-jdk17 sh -c "java -version"
+ [[ '' == ssh-* ]]
+ [[ '' == ssh-* ]]
setup-sshd params: sh -c java -version
Executing params: 'sh -c java -version'
+ env
+ grep _
+ [[ 3 -gt 0 ]]
+ echo 'setup-sshd params: sh' -c 'java -version'
+ [[ sh == ssh-* ]]
+ [[ sh -c java -version == \/\u\s\r\/\s\b\i\n\/\s\s\h\d\ \-\D\ \-\p\ \2\2 ]]
+ echo 'Executing params: '\''sh' -c 'java -version'\'''
+ exec sh -c 'java -version'
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode)
gounthar@his-machine:/mnt/c/Support/users/jenkins/git/ci/docker-ssh-agent (alpine-multi-stage)$ |
I guess the error has more to do with
than with the presence of Today, the message is somehow different, but the conveyed idea is the same:
|
How come tests have passed here? |
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.
LGTM!
Approving and merging since the "locale UTF-8" problem is fixed by adding the missing package.
The failing check is unrelated to the change here: it is also failing on the master branch
Thank you so much for your time and guidance. |
This is a follow-up/prequel to #251 in the hope of solving #243 in the end.
We used to get whatever Alpine version was used by Eclipse Temurin's image.
This PR proposes to separate the openJDK build from the Alpine version, by creating another stage.
The first stage takes Temurin's openJDK build (and compresses its size whenever it's possible through the use of
jlink
).The second stage starts from a fixed Alpine version and copies the pre-built openJDK binaries into it.
I've also created two variables (taken from docker-agent
docker-bake
example):ALPINE_FULL_TAG
: this will be passed as a parameter to theDockerfile
ALPINE_SHORT_TAG
: this will be used to create additional tagsTesting done
Submitter checklist