fix: return true when removing temporary files extracted from docker

If you are running docker in docker, the permissions on the generated file are such that they may not be accessible by the normal dokku user. For dokku, it is good enough to ignore the failed removal.
This commit is contained in:
Jose Diaz-Gonzalez
2019-08-05 15:57:54 -04:00
parent 5affe42699
commit 6fcb53113a

View File

@@ -391,7 +391,7 @@ copy_from_image() {
fi
TMP_FILE_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
trap "rm -rf '$TMP_FILE_COMMAND_OUTPUT' >/dev/null" RETURN
trap "rm -rf '$TMP_FILE_COMMAND_OUTPUT' >/dev/null || true" RETURN
local CID=$("$DOCKER_BIN" create "${DOCKER_CREATE_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "$IMAGE")
"$DOCKER_BIN" cp "$CID:$SRC_FILE" "$TMP_FILE_COMMAND_OUTPUT" 2>/dev/null || true