Commit 082cf5b 1 parent 2b029c4 commit 082cf5b Copy full SHA for 082cf5b
File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 64
64
image_id="$( cat "${iidfile}" )"
65
65
rm "${iidfile}"
66
66
67
+ # Extract various package info and version info to store as labels
68
+ container="$( buildah from "${image_id}" )"
69
+ run() { buildah run "${container}" "${@}" ; }
70
+ deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )"
71
+ pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )"
72
+ glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )"
73
+ debian="$( run cat /etc/debian_version | sed '1!d' )"
74
+ bash="$( run bash --version | sed '1!d' )"
75
+ buildah rm "${container}"
76
+
77
+ # Store package/version info as labels for the image
78
+ container="$( buildah from "${image_id}" )"
79
+ buildah config \
80
+ --label=glibc="${glibc}" \
81
+ --label=debian="${debian}" \
82
+ --label=bash="${bash}" \
83
+ --label=deb-list="${deb_list}" \
84
+ --label=pkg-list="${pkg_list}" \
85
+ "${container}"
86
+
87
+ # Store the new image (now with labels)
88
+ image_id="$( buildah commit "${container}" )"
89
+ buildah rm "${container}"
90
+
91
+ # image tag includes arch; then added to manifest which does not include arch
92
+ for tag in ${tags} ; do
93
+ buildah tag \
94
+ "${image_id}" \
95
+ "${image_name}:${tag}-${arch}"
96
+ buildah manifest add \
97
+ "${image_name}:${tag}" \
98
+ "${image_id}"
99
+ done
100
+ done
You can’t perform that action at this time.
0 commit comments