89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.41k stars 384 forks source link

[Error] git clone fails in init_hooks with distrobox assemble #1407

Closed RashiqAzhan closed 2 weeks ago

RashiqAzhan commented 1 month ago

Describe the bug Git clone in init_hook doesn't work with assemble. Container never starts.

To Reproduce Run distrobox assemble create.

distrobox.ini

[arch]
image=quay.io/toolbx/arch-toolbox:latest
pull=true
replace=true
start_now=true
additional_packages="git base-devel"
init_hooks=pacman -S --needed git base-devel;
init_hooks=git clone https://aur.archlinux.org/yay-bin.git;
init_hooks=cd yay-bin && makepkg -si;
init_hooks=ln -s /usr/bin/distrobox-host-exec /usr/local/bin/docker

Expected behavior Container starts.

Logs Run the commands with --verbose and post the log here as a file upload distrobox_assemblecreate--verbose.txt

Attach also the output of podman logs or docker logs, possibly with --latest flag podmanlogs--latest.txt

Desktop (please complete the following information):

89luca89 commented 2 weeks ago

yay cannot run as root

so what you can do is to run it with sudo as your user:

init_hooks=sudo -u your-user-name sh -c "cd yay-bin && makepkg -si"