Commit 30afb2e
committed
Support root-less containers with --in.vm
This updates to the latest image-builder-cli, adding support for
rootless container use
(osbuild/image-builder-cli#445).
It also updates the use of related APIs to pass runInVm options where
needed.
With this, I was able to run a rootless bc-i-b conversion. There is
one problem, which is that if you mount ~/.local/share/containers/storage on the host
to /var/lib/containers/storage in the contained, podman will complain with:
Error: database static dir "~/.local/share/containers/storage/libpod"
does not match our static dir "/var/lib/containers/storage/libpod":
database configuration mismatch
Additionally, if you pass the host "/var/lib/containers/storage" into
the rootless container you will get read permission errors.
There are two workarounds for this. Either you can use e.g. skopeo to
copy the bootc container to a separate (non-root) container storage
directory and mount that, or you can cover the "db.sql" file in the
storage directory to make podman not print the error.
Neither of these are super clean, and we should try to figure out a
better solution, but for now I was at least able to run a complete image build using:
```
$ touch /tmp/foo
$ podman run --rm --security-opt label=type:unconfined_t -ti --privileged \
--network=none -v $PWD/output:/output \
-v ~/.local/share/containers/storage:/var/lib/containers/storage \
-v /tmp/foo:/var/lib/containers/storage/db.sql \
localhost/bootc-image-builder --in-vm \
--rootfs ext4 --type raw \
quay.io/fedora/fedora-bootc:43
```1 parent a56bd7c commit 30afb2e
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
| 250 | + | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
0 commit comments