Skip to content

Commit

Permalink
fix: allow base=target
Browse files Browse the repository at this point in the history
  • Loading branch information
nkraetzschmar committed Aug 11, 2023
1 parent 5bb1d39 commit 29600b9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions unbase_oci
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ while [ $# -gt 0 ]; do
esac
done

for file in base target output; do
if [ "$file" = output ]; then touch "$1"; fi
container_mount_opts+=(-v "$(realpath "$1"):/mnt$(realpath "$1")")
args+=("/mnt$(realpath "$1")")
shift
done
container_mount_opts+=(-v "$(realpath "$1"):/mnt$(realpath "$1")")
[ "$1" = "$2" ] || container_mount_opts+=(-v "$(realpath "$2"):/mnt$(realpath "$2")")
container_mount_opts+=(-v "$(realpath "$3"):/mnt$(realpath "$3")")
args+=("/mnt$(realpath "$1")" "/mnt$(realpath "$2")" "/mnt$(realpath "$3")")

"$container_engine" run --rm --read-only --tmpfs /tmp:rw,exec "${container_mount_opts[@]}" "$container_image" "${args[@]}"

0 comments on commit 29600b9

Please sign in to comment.