Skip to content

Commit 3f9f9f4

Browse files
dockerfile/rpm: Setup new dnf repo with our built content
We do not want to use `--nodeps` for installing our built rpms in the target-rootfs. So, we create a new dnf repo in `/tmp/localrepo`, copy our rpms in there and set it's priority as highest. We pass `--install bootc` to bootc-base-imagectl which will install from our newly created repo ensuring we have the latest binaries in the final image Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent b208337 commit 3f9f9f4

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ RUN --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
7979

8080
install -D -m 0644 -t /var/add-dir/usr/lib/bootc/kargs.d /run/usr-extras/lib/bootc/kargs.d/*.toml
8181

82-
/usr/libexec/bootc-base-imagectl build-rootfs --add-dir /var/add-dir/usr --manifest=standard /target-rootfs
82+
/usr/libexec/bootc-base-imagectl build-rootfs \
83+
--install bootc \
84+
--install bootc-tests \
85+
--install system-reinstall-bootc \
86+
--add-dir /var/add-dir/usr \
87+
--manifest=standard /target-rootfs
8388
EOF
8489

85-
# Inject some other configuration
86-
COPY --from=packaging /usr-extras/ /target-rootfs/usr/
87-
8890
RUN --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp <<EOF
8991
set -eux
9092

contrib/packaging/install-rpm-and-setup

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,26 @@ set -xeuo pipefail
55
RPM_DIR="${1:-/tmp}"
66
INSTALL_ROOT="${2:-/}"
77

8-
# Install the RPM package
9-
# Use rpm -Uvh with --oldpackage to allow replacing with dev version
10-
rpm -Uvh --root "${INSTALL_ROOT}" --nodeps --replacepkgs --oldpackage --nosignature "${RPM_DIR}"/*.rpm
11-
# Note: we don't need to clean up the source directory since it's a bind mount
8+
# We'll create a new dnf repo to install our newer stuff
9+
dnf install -y createrepo_c
10+
11+
mkdir /tmp/localrepo
12+
cp "${RPM_DIR}"/*.rpm /tmp/localrepo/
13+
14+
createrepo_c /tmp/localrepo
15+
16+
# Create a .repo file with higher priority so that our newer
17+
# stuff is installed inside the target-rootfs
18+
cat <<EOF > /etc/yum.repos.d/local.repo
19+
[local]
20+
name=Local CI repo
21+
baseurl=file:///tmp/localrepo
22+
enabled=1
23+
gpgcheck=0
24+
priority=1
25+
EOF
26+
27+
mkdir -p "${INSTALL_ROOT}/usr/lib/bootc/install"
1228

1329
# Only in this containerfile, inject a file which signifies
1430
# this comes from this development image. This can be used in

0 commit comments

Comments
 (0)