@@ -64,10 +64,6 @@ main ()
OCI=$(which "$CONTAINERCMD")
- # docker build doesn't accept 2 colons, so "sanitize" the name
- local sanitized_dockername
- sanitized_dockername=$(echo "$image" | tr ':.' '-')
-
local version
version=$(echo "$image" | awk -F: '{print $NF}')
@@ -139,8 +135,13 @@ main ()
;;
esac
+ local image_sha
+ image_id_file=$(mktemp)
+ # Don't clutter tmpfs on fails
+ trap 'rm -f "$image_id_file"' EXIT
+
$OCI build \
- --tag "yocto-docs-$sanitized_dockername:latest" \
+ --iidfile "$image_id_file" \
--build-arg ARG_FROM="docker.io/$image" \
--build-arg DOCS="$docs" \
--build-arg DOCS_PDF="$docs_pdf" \
@@ -148,6 +149,9 @@ main ()
--file "$SCRIPT_DIR/$containerfile" \
"$SH_DIR/"
+ image_sha="$(< "$image_id_file")"
+ rm "$image_id_file"
+
local -a args_run=(
--rm
--interactive
@@ -171,7 +175,7 @@ main ()
$OCI run \
"${args_run[@]}" \
- "yocto-docs-$sanitized_dockername" \
+ "$image_sha" \
"$@"
}