@@ -41,14 +41,12 @@ oses="alpine ubuntu ubi windowsservercore-ltsc2022 nanoserver-ltsc2022 windowsse
4141# The image which is used by default when pulling shared tags on linux e.g 8-jdk
4242default_linux_image=" noble"
4343
44- git_repo=" https://github.com/adoptium/containers/blob/master"
45-
4644# Get the latest git commit of the current repo.
4745# This is assumed to have all the latest dockerfiles already.
4846gitcommit=$( git log | head -1 | awk ' { print $2 }' )
4947
5048print_official_text () {
51- echo " $* " >> ${official_docker_image_file}
49+ echo " $* " >> " ${official_docker_image_file} "
5250}
5351
5452print_official_header () {
@@ -71,9 +69,9 @@ function generate_official_image_tags() {
7169 ojdk_version=${ojdk_version// +/ _}
7270
7371 case $os in
74- " ubuntu" ) distro=$( echo $dfdir | awk -F ' /' ' { print $4 }' ) ;;
75- " ubi" ) distro=$( echo $dfdir | awk -F ' /' ' { print $4 }' ) ;;
76- " windows" ) distro=$( echo $dfdir | awk -F ' /' ' { print $4 }' ) ;;
72+ " ubuntu" ) distro=$( echo " $dfdir " | awk -F ' /' ' { print $4 }' ) ;;
73+ " ubi" ) distro=$( echo " $dfdir " | awk -F ' /' ' { print $4 }' ) ;;
74+ " windows" ) distro=$( echo " $dfdir " | awk -F ' /' ' { print $4 }' ) ;;
7775 * ) distro=$os ;;
7876 esac
7977
@@ -82,10 +80,8 @@ function generate_official_image_tags() {
8280 # 8u212-jdk
8381 full_ver_tag=" ${ojdk_version} -${pkg} "
8482
85- unset extra_shared_tags extra_ver_tags
83+ unset extra_shared_tags
8684 full_ver_tag=" ${full_ver_tag} -${distro} "
87- # Commented out as this added the -hotspot tag which we don't need for temurin
88- # extra_ver_tags=", ${ver}-${pkg}"
8985
9086 ver_tag=" ${ver} -${pkg} -${distro} "
9187 all_tags=" ${full_ver_tag} , ${ver_tag} "
@@ -94,7 +90,6 @@ function generate_official_image_tags() {
9490 jdk_tag=" ${ver} -${distro} "
9591 all_tags=" ${all_tags} , ${jdk_tag} "
9692 # make "eclipse-temurin:latest" point to newest supported JDK
97- # shellcheck disable=SC2154
9893 if [ " ${ver} " == " ${latest_version} " ]; then
9994 if [ " ${vm} " == " hotspot" ]; then
10095 extra_shared_tags=" , latest"
@@ -103,44 +98,46 @@ function generate_official_image_tags() {
10398 fi
10499
105100 unset windows_shared_tags
106- shared_tags=$( echo ${all_tags} | sed " s/-$distro //g" )
107- if [ $os == " windows" ]; then
108- windows_version=$( echo $distro | awk -F ' -' ' { print $1 }' )
109- windows_version_number=$( echo $distro | awk -F ' -' ' { print $2 }' )
110- windows_shared_tags=$( echo ${all_tags} | sed " s/$distro /$windows_version /g" )
101+ shared_tags=" ${all_tags// -$distro / } "
102+
103+ if [ " $os " == " windows" ]; then
104+ windows_version=$( echo " $distro " | awk -F ' -' ' { print $1 }' )
105+ windows_version_number=$( echo " $distro " | awk -F ' -' ' { print $2 }' )
106+ windows_shared_tags=" ${all_tags// $distro / $windows_version } "
111107 case $distro in
112108 nanoserver* )
113109 constraints=" ${distro} , windowsservercore-${windows_version_number} "
114110 all_shared_tags=" ${windows_shared_tags} "
115111 ;;
116112 * )
117113 constraints=" ${distro} "
118- all_shared_tags=" ${windows_shared_tags} , ${shared_tags}${extra_ver_tags}${ extra_shared_tags} "
114+ all_shared_tags=" ${windows_shared_tags} , ${shared_tags}${extra_shared_tags} "
119115 ;;
120116 esac
121117 else
122- all_shared_tags=" ${shared_tags}${extra_ver_tags}${ extra_shared_tags} "
118+ all_shared_tags=" ${shared_tags}${extra_shared_tags} "
123119 fi
124120}
125121
126122function generate_official_image_arches() {
127123 # Generate the supported arches for the above tags.
128- # Official images supports amd64, arm64vX, s390x, ppc64le amd windows-amd64
129- if [ $os == " windows" ]; then
124+ # Official images support amd64, arm64vX, s390x, ppc64le, and windows-amd64
125+ if [ " $os " == " windows" ]; then
130126 arches=" windows-amd64"
131127 else
132128 # shellcheck disable=SC2046,SC2005,SC1003,SC2086,SC2063
133129 arches=$( echo $( grep ' ) \\' ${file} | grep -v " *" | sed ' s/) \\//g; s/|//g' ) )
134- arches=$( echo $ {arches} | sed ' s/ x86_64/amd64/g ' ) # replace x86_64 with amd64
135- arches=$( echo $ {arches} | sed ' s/ ppc64el/ppc64le/g ' ) # replace ppc64el with ppc64le
136- arches=$( echo $ {arches} | sed ' s/ arm64/arm64v8/g ' ) # replace arm64 with arm64v8
137- arches=$( echo $ {arches} | sed ' s/ aarch64/arm64v8/g ' ) # replace aarch64 with arm64v8
138- arches=$( echo $ {arches} | sed ' s/ armhf/arm32v7/g ' ) # replace armhf with arm32v7
130+ arches=" $ {arches// x86_64/ amd64} " # replace x86_64 with amd64
131+ arches=" $ {arches// ppc64el/ ppc64le} " # replace ppc64el with ppc64le
132+ arches=" $ {arches// arm64/ arm64v8} " # replace arm64 with arm64v8
133+ arches=" $ {arches// aarch64/ arm64v8} " # replace aarch64 with arm64v8
134+ arches=" $ {arches// armhf/ arm32v7} " # replace armhf with arm32v7
139135 # sort arches alphabetically
140- arches=$( echo ${arches} | tr ' ' ' \n' | sort | tr ' \n' ' ' | sed ' s/ /, /g' | sed ' s/, $//' )
136+ arches=$( echo " ${arches} " | tr ' ' ' \n' | sort | tr ' \n' ' ' | sed ' s/ /, /g' | sed ' s/, $//' )
141137 fi
142138}
143139
140+
144141function print_official_image_file() {
145142 # Retrieve the latest manifest block
146143 official_manifest=$( sed -n " /${all_tags} /,/^$/p" official-eclipse-temurin)
@@ -178,15 +175,15 @@ function print_official_image_file() {
178175 echo " Architectures: ${arches} "
179176 echo " GitCommit: ${commit} "
180177 echo " Directory: ${dfdir} "
181- if [ $os == " windows" ]; then
178+ if [ " $os " == " windows" ]; then
182179 echo " Builder: classic"
183180 echo " Constraints: ${constraints} "
184181 fi
185182 echo " "
186- } >> ${official_docker_image_file}
183+ } >> " ${official_docker_image_file} "
187184}
188185
189- rm -f ${official_docker_image_file}
186+ rm -f " ${official_docker_image_file} "
190187print_official_header
191188
192189official_os_ignore_array=(clefos debian debianslim leap tumbleweed)
@@ -201,7 +198,7 @@ function generate_official_image_info() {
201198 fi
202199 done
203200 if [ " ${os} " == " windows" ]; then
204- distro=$( echo $dfdir | awk -F ' /' ' { print $4 }' )
201+ distro=$( echo " $dfdir " | awk -F ' /' ' { print $4 }' )
205202 # 20h2 and 1909 is not supported upstream
206203 if [[ " ${distro} " == " windowsservercore-20h2" ]] || [[ " ${distro} " == " windowsservercore-1909" ]] || [[ " ${distro} " == " windowsservercore-ltsc2019" ]] ; then
207204 return ;
@@ -210,10 +207,6 @@ function generate_official_image_info() {
210207 return ;
211208 fi
212209 fi
213- # We do not push our nightly and slim images either.
214- if [ " ${build} " == " nightly" ] || [ " ${btype} " == " slim" ]; then
215- return ;
216- fi
217210
218211 generate_official_image_tags
219212 generate_official_image_arches
239232 # dockerfile name
240233 dfname=$( basename " ${file} " )
241234 # dockerfile dir
242- dfdir=$( dirname $ file | cut -c 3-)
235+ dfdir=$( dirname " ${ file} " | cut -c 3-)
243236 os=$( echo " ${file} " | awk -F ' /' ' { print $4 }' )
244- # build = release or nightly
245- # build=$(echo "${dfname}" | awk -F "." '{ print $3 }')
246- build=" release"
247- # btype = full or slim
248- # btype=$(echo "${dfname}" | awk -F "." '{ print $4 }')
249- build=" full"
250237 generate_official_image_info
251238 done
252239 done
0 commit comments