* Add --hostname argument and DBX_CONTAINER_HOSTNAME env var
* Update usage/distrobox-create.md and useful_tips.md
* Refining error message when hostname is too long
* init: add nvidia integration
This is a preliminary work to implement host's nVidia driver's
integration, in the guest.
The procedure is simple enough, it will try and find all nVidia related
files in the host, and bind mount them in the guest.
---------
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Co-authored-by:: Luca Di Maio <luca.dimaio1@gmail.com>
Co-authored-by: Dario Faggioli <dfaggioli@suse.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
This utility is automatically called by create and rm, so newer
distroboxes created with this version onward will automatically be added
to you applications list.
This tool can also be called separately to create/recreate/remove an
entry.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Right now, default name for a toolbox is `fedora-toolbox-XX`, which
corresponds to the same pattern also distrobox uses for its default.
Change the default behavior to use `my-distrobox` in case no name and no
image are specified, in order to not have clashes with the other
project.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
If either DBX_CONTAINER_ALWAYS_PULL or container_always_pull in config is set,
'create' will pull the latest image without prompting
(even if image already exists locally).
Use this to ensure the new toolbox is based on the most current image
instead of an old out-dated one.
* Implement pre-initialization hooks
This implements support for running commands prior to most of the
container initialization. e.g. for RHEL and derivatives you might need
to pre-enable the PowerTools/CRB and EPEL repositories.
Resolves: #220
```
distrobox on main [!⇡]
✦ ❯ ./distrobox create -i registry.fedoraproject.org/fedora-toolbox:36 f36-packaging
a3cc54e5a820b6bd95286ec142cb3eeab7f72b42cebf6fa0d3c0072035b3bca4
Distrobox 'f36-packaging' successfully created.
To enter, run:
distrobox-enter f36-packaging
distrobox on main [!⇡]
✦ ❯ ./distrobox enter f36-packaging
Container f36-packaging is not runnung.
Starting container f36-packaging
run this command to follow along:
podman logs -f f36-packaging
Starting container... [ OK ]
Installing basic packages... [ OK ]
Setting up read-only mounts... [ OK ]
Setting up read-write mounts... [ OK ]
Setting up host's sockets integration... [ OK ]
Integrating host's themes, icons, fonts... [ OK ]
Setting up package manager exceptions... [ OK ]
Setting up sudo... [ OK ]
Setting up groups... [ OK ]
Setting up users... [ OK ]
Executing init hooks... [ OK ]
Container Setup Complete!
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
distrobox on main [!⇡]
⬢ [fedora-toolbox:36] ❯
```
Enable PowerTools (recommended to use EPEL) and EPEL Next, so
`distrobox` can install the Fish shell.
```
distrobox on main [!⇡]
✦ ❯ ./distrobox create -i quay.io/centos/centos:stream8 c8s --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-next-release"
9b17e8cfbf8e7a26abdc7a78b2325e1ee4a9577662b0fe94fbde4260269e1ce3
Distrobox 'c8s' successfully created.
To enter, run:
distrobox-enter c8s
distrobox on main [!⇡]
✦ ❯ ./distrobox enter c8s
Container c8s is not runnung.
Starting container c8s
run this command to follow along:
podman logs -f c8s
Starting container... [ OK ]
Executing pre-init hooks... [ OK ]
Installing basic packages... [ OK ]
Setting up read-only mounts... [ OK ]
Setting up read-write mounts... [ OK ]
Setting up host's sockets integration... [ OK ]
Integrating host's themes, icons, fonts... [ OK ]
Setting up package manager exceptions... [ OK ]
Setting up sudo... [ OK ]
Setting up groups... [ OK ]
Setting up users... [ OK ]
Executing init hooks... [ OK ]
Container Setup Complete!
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
distrobox on main
⬢ [centos:stream8] ❯
```
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* Fix typo: s/runnung/running
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* simplify pre-init-hooks detection, add useful tips
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* More changes to address review feedback
- distrobox-init: indent new if block
- distrobox-create: restore quote around pre-init-hooks arguments
- docs/usage: document new create and init options
- docs/useful_tips: explain the rationale behind --pre-init-hooks
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
This commit will add the `--root/-r` flag to create,enter,list,rm,stop
commands. This will enable the use of podman/docker in root mode. This
is the preferred way over `sudo distrobox`.
Update man pages and docs accordingly.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>