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

[Suggestion] Command to run a program in a container #1414

Closed Xanderplayz16 closed 2 weeks ago

Xanderplayz16 commented 1 month ago

Is your feature request related to a problem? Please describe. I am creating a script that uses Distrobox, and I can't find a good way to do this.

Describe the solution you'd like I would like something like a command that runs an program inside a container, like: distrobox-exec mycontainer "/bin/bash -c 'dosomething | somethingelse && morecompute >/dev/null'"

fbartels commented 1 month ago

When using distrobox export it creates a wrapper script with the following command to directly executy a command in a distrobox:

$HOME/.local/bin/distrobox-enter  -n name-of-distrobox  --  '/usr/bin/code'  "$@"
89luca89 commented 2 weeks ago

Just read the distrobox-enter docs/man page/help and you'll see there is a flag for that