Skip to content

Commit 64656c9

Browse files
committed
1. manifest build is currently broken as the OS and the distro cannot be
used interchangeably. Using "os" and "os_family" to indicate "distro" and "generic OS" respectively to reduce code changes. 2. Remove maintainer LABEL, no longer a standard practice for docker images. 3. Have jshell as default CMD only for jdk builds and not jre ones. 4. Add arm64 manifest entries for aarch64. 5. Added back spaces in the Dockerfiles between statements to keep it readable.
1 parent 6f74778 commit 64656c9

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

common_functions.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,34 @@ function set_arch_os() {
6666
armv7l)
6767
current_arch="armv7l"
6868
oses="ubuntu debian"
69+
os_family="linux"
6970
;;
7071
aarch64)
7172
current_arch="aarch64"
7273
oses="ubuntu debian"
74+
os_family="linux"
7375
;;
7476
ppc64el|ppc64le)
7577
current_arch="ppc64le"
7678
oses="ubuntu debian"
79+
os_family="linux"
7780
;;
7881
s390x)
7982
current_arch="s390x"
8083
oses="ubuntu debian"
84+
os_family="linux"
8185
;;
8286
amd64|x86_64)
8387
case $(uname) in
8488
MINGW64*|MSYS_NT*)
8589
current_arch="x86_64"
8690
oses="windows"
91+
os_family="windows"
8792
;;
8893
*)
8994
current_arch="x86_64"
9095
oses="ubuntu alpine debian"
96+
os_family="linux"
9197
;;
9298
esac
9399
;;

dockerfile_functions.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,11 @@ print_alpine_ver() {
7676
EOI
7777
}
7878

79-
# Print the maintainer
80-
print_maint() {
81-
cat >> $1 <<-EOI
82-
LABEL org.opencontainers.image.authors="[email protected]"
83-
EOI
84-
}
85-
8679
# Print the locale and language
8780
print_lang_locale() {
8881
cat >> $1 <<-EOI
8982
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
83+
9084
EOI
9185
}
9286

@@ -159,6 +153,7 @@ print_env() {
159153
cat >> $1 <<-EOI
160154
161155
ENV JAVA_VERSION ${jver}
156+
162157
EOI
163158
}
164159

@@ -403,7 +398,7 @@ EOI
403398
print_cmd() {
404399
# for version > 8, set CMD["jshell"] in the Dockerfile
405400
above_8="^(9|[1-9][0-9]+)$"
406-
if [[ "${version}" =~ ${above_8} ]]; then
401+
if [[ "${version}" =~ ${above_8} && "${package}" == "jdk" ]]; then
407402
cat >> $1 <<-EOI
408403
CMD ["jshell"]
409404
EOI
@@ -425,7 +420,6 @@ generate_dockerfile() {
425420
echo -n "Writing ${file} ... "
426421
print_legal ${file};
427422
print_${os}_ver ${file} ${bld} ${btype};
428-
print_maint ${file};
429423
print_lang_locale ${file};
430424
print_${os}_pkg ${file};
431425
print_env ${file} ${bld} ${btype};

generate_manifest_script.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ function print_annotate_cmd() {
3131

3232
# The manifest tool expects "amd64" as arch and not "x86_64"
3333
march=$(echo ${arch_tag} | awk -F':' '{ print $2 }' | awk -F'-' '{ print $1 }')
34-
if [ ${march} == "x86_64" ]; then
34+
case ${march} in
35+
x86_64)
3536
march="amd64"
36-
fi
37-
echo "\"${manifest_tool}\" manifest annotate ${main_tag} ${arch_tag} --os ${os} --arch ${march}" >> ${man_file}
37+
;;
38+
aarch64)
39+
march="arm64"
40+
;;
41+
*)
42+
;;
43+
esac
44+
echo "\"${manifest_tool}\" manifest annotate ${main_tag} ${arch_tag} --os ${os_family} --arch ${march}" >> ${man_file}
3845
}
3946

4047
# Space separated list of tags

0 commit comments

Comments
 (0)