File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function get_option() {
33
33
34
34
function empty_base() {
35
35
local registry=$1
36
- local ref=" $registry /image :latest"
36
+ local ref=" $registry /oci/empty_base :latest"
37
37
ref=" $( " ${CRANE} " append --oci-empty-base -t " ${ref} " -f {{empty_tar}}) "
38
38
ref=$( " ${CRANE} " config " ${ref} " | " ${JQ} " " .rootfs.diff_ids = [] | .history = []" | " ${CRANE} " edit config " ${ref} " )
39
39
ref=$( " ${CRANE} " manifest " ${ref} " | " ${JQ} " " .layers = []" | " ${CRANE} " edit manifest " ${ref} " )
@@ -158,8 +158,12 @@ if [ ${#ENV_EXPANSIONS[@]} -ne 0 ]; then
158
158
fi
159
159
160
160
if [ -n " $OUTPUT " ]; then
161
- " ${CRANE} " pull " ${REF} " " ./${OUTPUT} " --format=oci --prune
162
- stop_registry " ${STORAGE_DIR} "
161
+ " ${CRANE} " pull " ${REF} " " ./${OUTPUT} " --format=oci --annotate-ref
162
+ mv " ${OUTPUT} /index.json" " ${OUTPUT} /temp.json"
163
+ " ${JQ} " --arg ref " ${REF} " ' .manifests |= map(select(.annotations["org.opencontainers.image.ref.name"] == $ref)) | del(.manifests[0].annotations)' " ${OUTPUT} /temp.json" > " ${OUTPUT} /index.json"
164
+ rm " ${OUTPUT} /temp.json"
165
+ " ${CRANE} " layout gc " ./${OUTPUT} "
166
+ stop_registry " ${OUTPUT} "
163
167
fi
164
168
165
169
} 2>> " ${STDERR} "
You can’t perform that action at this time.
0 commit comments