Skip to content

Commit de8a316

Browse files
Update images.txt format:
This adds the ability to remove the "source image" tag from the final embedded images. This leaves only the "additional tag". Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 58eb394 commit de8a316

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This is an example file. It explains the required format.
22
# For the actual file, you must remove all the comments.
3-
# The format is source image, a single space, optional additional tag of the source image.
4-
#<source image> <optional additional tag of the source image>
3+
# The format is source image, a single space, optional additional tag of the source image, a single space, true or false to remove the original tag.
4+
#<source image> <optional additional tag of the source image> <remove original tag>
55
# for example:
66
quay.io/tinkerbell/tink-worker:v0.10.0
7-
quay.io/tinkerbell/tink-worker:v0.10.0 tink-worker:v0.10.0
7+
quay.io/tinkerbell/tink-worker:v0.10.0 tink-worker:v0.10.0 true
88
quay.io/tinkerbell/actions/image2disk embedded/actions/image2disk
9-
quay.io/tinkerbell/actions/cexec 127.0.0.1/embedded/actions/cexec
9+
quay.io/tinkerbell/actions/cexec 127.0.0.1/embedded/actions/cexec true

images/hook-embedded/pull-images.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ function main() {
9090
# clean up tar files
9191
rm -rf "${output_dir}"/*
9292

93-
# Create any tags for the images
94-
while IFS=" " read -r first_image image_tag || [ -n "${first_image}" ] ; do
93+
# Create any tags for the images and remove any original tags
94+
while IFS=" " read -r first_image image_tag remove_original || [ -n "${first_image}" ] ; do
9595
if [[ "${image_tag}" != "" ]]; then
9696
docker exec "${dind_container}" docker tag "${first_image}" "${image_tag}"
97+
if [[ "${remove_original}" == "true" ]]; then
98+
docker exec "${dind_container}" docker rmi "${first_image}"
99+
fi
97100
fi
98101
done < "${images_file}"
99102

0 commit comments

Comments
 (0)