Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy files using coreutils cp #595

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions oci/private/image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ function base_from() {
relative="$(coreutils realpath --relative-to="$OUTPUT/blobs/sha256" "$blob" --no-symlinks)"
coreutils ln -s "$relative" "$OUTPUT/blobs/$relative_to_blobs"
else
coreutils cat "$blob" > "$OUTPUT/blobs/$relative_to_blobs"
coreutils cp --no-preserve=mode "$blob" "$OUTPUT/blobs/$relative_to_blobs"
fi
done
coreutils cat "$path/oci-layout" >"$OUTPUT/oci-layout"
coreutils cp --no-preserve=mode "$path/oci-layout" "$OUTPUT/oci-layout"
jq '.manifests[0].annotations["org.opencontainers.image.ref.name"] = "intermediate"' "$path/index.json" >"$OUTPUT/index.json"
}

Expand Down Expand Up @@ -110,7 +110,7 @@ function add_layer() {
relative=$(coreutils realpath --no-symlinks --canonicalize-missing --relative-to="$OUTPUT/blobs/sha256" "$path" )
coreutils ln --force --symbolic "$relative" "$output_path"
else
coreutils cat "$path" > "$output_path"
coreutils cp --no-preserve=mode "$path" "$output_path"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions oci/private/image_index.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function add_image() {
--argjson manifest "${manifest}" \
'.manifests |= [$manifest + {"platform": $platform}]'\
"${output_path}/manifest_list.json" > "${output_path}/manifest_list.new.json"
cat "${output_path}/manifest_list.new.json" > "${output_path}/manifest_list.json"
"${COREUTILS}" cp --no-preserve=mode "${output_path}/manifest_list.new.json" "${output_path}/manifest_list.json"
done
}

Expand All @@ -36,7 +36,7 @@ function copy_blob() {
local blob_image_relative_path="$3"
local dest_path="${output_path}/${blob_image_relative_path}"
mkdirp "$(dirname "${dest_path}")"
"${COREUTILS}" cat "${image_path}/${blob_image_relative_path}" > "${dest_path}"
"${COREUTILS}" cp --no-preserve=mode "${image_path}/${blob_image_relative_path}" "${dest_path}"
}

function create_oci_layout() {
Expand Down
Loading