Skip to content

Commit 83f6cf4

Browse files
authored
Merge pull request #604 from vdice/fix/shim-downloader-multiple-files
fix(downloader): extract only the shim binary from the archive
2 parents fbaac00 + c4d48a2 commit 83f6cf4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

images/downloader/download_shim.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ log "$(tar --version)" "INFO"
5050
log "md5sum: $(md5sum containerd-shim-${SHIM_NAME})" "INFO"
5151
log "sha256sum: $(sha256sum containerd-shim-${SHIM_NAME})" "INFO"
5252

53-
tar -xzf "containerd-shim-${SHIM_NAME}" -C /assets
53+
tar -xzf "containerd-shim-${SHIM_NAME}" -C /tmp
54+
# there may be multiple files in the archive; only copy the shim binary to /assets
55+
cp /tmp/containerd-shim-${SHIM_NAME} /assets
5456
log "download successful:" "INFO"
5557

5658
# Verify SHA-256 if provided
5759
if [ -n "${SHIM_SHA256:-}" ]; then
5860
log "verifying SHA-256 digest..." "INFO"
59-
if echo "${SHIM_SHA256} containerd-shim-${SHIM_NAME}" | sha256sum -c -; then
61+
if echo "${SHIM_SHA256} containerd-shim-${SHIM_NAME}" | sha256sum -c -; then
6062
log "SHA-256 verification passed" "INFO"
6163
else
6264
log "SHA-256 verification FAILED: expected ${SHIM_SHA256} for containerd-shim-${SHIM_NAME}" "ERROR"

0 commit comments

Comments
 (0)