-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoci.sh
More file actions
executable file
·36 lines (25 loc) · 830 Bytes
/
oci.sh
File metadata and controls
executable file
·36 lines (25 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
FEDORA_VERSION=${FEDORA_VERSION:-43}
# Create buildah from scratch
BOCI=$(buildah from scratch)
# Trap to remove on errors
trap 'buildah rm $BOCI' ERR
# Mount the filesystem
MOCI=$(buildah mount $BOCI)
# Copy rpms from ./build/RPMS/fVER for each fVER
for DIR in ./build/RPMS/f${FEDORA_VERSION}/*; do
if [ ! -d "$DIR" ]; then
continue
fi
# Copy only binary RPMs (exclude src.rpm) directly into rpms/
find "$DIR" -type f -name "*.rpm" ! -name "*.src.rpm" -exec cp -t "$MOCI/" {} +
done
# Unmount the filesystem
buildah unmount $BOCI
# Commit the image
buildah commit $BOCI nvidia-oci-f${FEDORA_VERSION}
# Get digest
DIGEST=$(buildah images --noheading --format "{{.Digest}}" nvidia-oci-f${FEDORA_VERSION})
echo "OCI Image created with digest: $DIGEST"
echo $DIGEST > .oci-digest