Skip to content

Commit 3ece381

Browse files
Update linuxkit container image naming:
After pushing images was fixed, the naming of the images needed updated to match the existing hook-* naming schema. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent e0d143c commit 3ece381

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

bash/hook-lk-containers.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@ function build_all_hook_linuxkit_containers() {
66

77
# when adding new container builds here you'll also want to add them to the
88
# `linuxkit_build` function in the linuxkit.sh file.
9-
build_hook_linuxkit_container images/hook-bootkit HOOK_CONTAINER_BOOTKIT_IMAGE
10-
build_hook_linuxkit_container images/hook-docker HOOK_CONTAINER_DOCKER_IMAGE
11-
build_hook_linuxkit_container images/hook-mdev HOOK_CONTAINER_MDEV_IMAGE
12-
build_hook_linuxkit_container images/containerd HOOK_CONTAINER_CONTAINERD_IMAGE
13-
build_hook_linuxkit_container images/runc HOOK_CONTAINER_RUNC_IMAGE
9+
# # NOTE: linuxkit containers must be in the images/ directory
10+
build_hook_linuxkit_container hook-bootkit HOOK_CONTAINER_BOOTKIT_IMAGE
11+
build_hook_linuxkit_container hook-docker HOOK_CONTAINER_DOCKER_IMAGE
12+
build_hook_linuxkit_container hook-mdev HOOK_CONTAINER_MDEV_IMAGE
13+
build_hook_linuxkit_container hook-containerd HOOK_CONTAINER_CONTAINERD_IMAGE
14+
build_hook_linuxkit_container hook-runc HOOK_CONTAINER_RUNC_IMAGE
1415
}
1516

1617
function build_hook_linuxkit_container() {
1718
declare container_dir="${1}"
1819
declare -n output_var="${2}" # bash name reference, kind of an output var but weird
20+
declare container_base_dir="images"
1921

2022
# Lets hash the contents of the directory and use that as a tag
2123
declare container_files_hash
22-
container_files_hash="$(find "${container_dir}" -type f -print | LC_ALL=C sort | xargs sha256sum | sha256sum | cut -d' ' -f1)"
24+
# NOTE: linuxkit containers must be in the images/ directory
25+
container_files_hash="$(find "${container_base_dir}/${container_dir}" -type f -print | LC_ALL=C sort | xargs sha256sum | sha256sum | cut -d' ' -f1)"
2326
declare container_files_hash_short="${container_files_hash:0:8}"
2427

2528
declare container_oci_ref="${HOOK_LK_CONTAINERS_OCI_BASE}${container_dir}:${container_files_hash_short}-${DOCKER_ARCH}"
26-
log info "Consider building LK container ${container_oci_ref} from ${container_dir} for platform ${DOCKER_ARCH}"
29+
log info "Consider building LK container ${container_oci_ref} from ${container_base_dir}/${container_dir} for platform ${DOCKER_ARCH}"
2730
output_var="${container_oci_ref}" # the the name reference
2831
echo "${output_var}" > /dev/null # no-op; just to avoid shellcheck SC2034 (unused var; but it is actually a bash nameref)
2932

@@ -50,13 +53,13 @@ function build_hook_linuxkit_container() {
5053
exit 9
5154
fi
5255

53-
log info "Building ${container_oci_ref} from ${container_dir} for platform ${DOCKER_ARCH}"
56+
log info "Building ${container_oci_ref} from ${container_base_dir}/${container_dir} for platform ${DOCKER_ARCH}"
5457
(
55-
cd "${container_dir}" || exit 1
58+
cd "${container_base_dir}/${container_dir}" || exit 1
5659
docker buildx build --load "--progress=${DOCKER_BUILDX_PROGRESS_TYPE}" -t "${container_oci_ref}" --platform "linux/${DOCKER_ARCH}" .
5760
)
5861

59-
log info "Built ${container_oci_ref} from ${container_dir} for platform ${DOCKER_ARCH}"
62+
log info "Built ${container_oci_ref} from ${container_base_dir}/${container_dir} for platform ${DOCKER_ARCH}"
6063

6164
push_hook_linuxkit_container "${container_oci_ref}"
6265

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)