Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing without rootful nor copying #10

Open
cgwalters opened this issue Apr 22, 2024 · 2 comments
Open

Installing without rootful nor copying #10

cgwalters opened this issue Apr 22, 2024 · 2 comments

Comments

@cgwalters
Copy link
Contributor

https://gitlab.com/bootc-org/podman-bootc-cli/-/issues/8

Currently, to install to container we only have 2 options:

  • Set podman machine as rootful
  • Work as unprivileged user and then podman save ... and (as root) podman load ..., so copying the image from the user to root to do the installation.

I think we can install the container without copying the image or requiring a rootful podman machine

@cgwalters
Copy link
Contributor Author

From @germag

I was able to run the fedora-bootc container as root using the user image storage:
(inside podman machine)

#!/bin/sh

USER=core
HOME=/home/core/.local/share/containers/storage

read_file()
{
    su - $USER -c "podman unshare cat $1" 2>/dev/null | awk '{if(NR>1){printf("#")}printf($2 "-" $1 "-" $3)}'
}

uids=$(read_file "/proc/self/uid_map")
gids=$(read_file "/proc/self/gid_map")

podman run --privileged -it --rm -v "$HOME:/usr/lib/containers/storage:idmap=uids=$uids;gids=$gids" -v "/home/german:/home/german" podman 

the fedora-bootc image is in the core user storage, and the disk image is in the german user (outside the podman machine). After getting a shell inside the podman container, I can run the fedora-bootc container:

podman run --rm --privileged  -v "/home/german/.cache/podman-bootc/6f57b46c5b990e04bf490711e2746c5351b926a8ab0b35d0d3fe202dbe20229c/:/output" -it quay.io/centos-bootc/fedora-bootc:eln

and now try to install it:

bootc install to-disk --via-loopback --generic-image --skip-fetch-check /output/disk.raw 

but I get the following error:

Error: no such object: "0049a65c78d53fc999ef2623884d7c0ff5d141ca48e84839cd4818b648cdf36f"
ERROR Installing to disk: Gathering source info from container env: Task podman inspect failed: ExitStatus(unix_wait_status(32000))

@cgwalters
Copy link
Contributor Author

Error: no such object: "0049a65c78d53fc999ef2623884d7c0ff5d141ca48e84839cd4818b648cdf36f"

Hmm that's weird, what's in /ostree in this scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant