Commit Graph
1918 Commits
Author SHA1 Message Date
Alessio Biancalana ff4cc63ac3 fix: bump install script next branch to rc4 (#2179) 2026-07-30 09:45:15 +02:00
Luca Di Maio 0c3f8d6472 test(nvidia): add debian as a tested host and guest distro
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-26 17:59:08 +02:00
Luca Di Maio 32bb5e8727 Merge pull request #2171 from 89luca89/feat/gpu-integration-improvements
fix(gpu): isolate NVIDIA libraries and fix Docker device groups for ROCm
2.0.0-rc.4
2026-07-25 18:00:53 +02:00
Luca Di Maio 3b5253e5c5 ci(nvidia): run the --nvidia VM e2e test on relevant PRs
The harness boots real VMs, so gate it to PRs touching distrobox-init or the
test itself instead of every push.

Base images use a split cache restore/save and on failure the per-distro log
dir is uploaded so it's debuggable without a re-run.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 17:19:55 +02:00
Luca Di Maio 5611967de8 test(nvidia): add local VM e2e test for --nvidia driver mirroring
The --nvidia path had no automated coverage and regresses easily (silent
32/64-bit collisions, dropped files), and GPU CI runners to exercise it
don't exist. This harness needs no GPU: it installs the nvidia driver in a
throwaway VM, runs `distrobox create --nvidia` against ubuntu/fedora/arch
guests, and checks every file the host package manager ships is mirrored in
with a matching checksum and resolvable deps. The package manifest is the
source of truth, so any gap fails loudly instead of silently.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 17:19:55 +02:00
Luca Di Maio 4fadc607d3 fix(docker): forward host supplementary groups for GPU device access
ROCm and other GPU workloads reach the device through /dev/kfd and
/dev/dri/renderD*, which are typically owned by group render (mode 0660).
Podman keeps the invoking user's supplementary groups via the
run.oci.keep_original_groups annotation, but the docker path forwarded only
the primary gid, so the container user was not in render/video and hit EACCES.

This generally puts docker on par with podman+crun
run.oci.keep_original_groups annotation.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 17:19:21 +02:00
Luca Di Maio ee5724ee62 fix(init): isolate NVIDIA driver libraries in a dedicated dir
The --nvidia path mapped each driver library to a guest destination by
rewriting its host path (x86_64-linux-gnu / lib64 / lib32 via sed), which is
fragile across distros and can shadow the guest's own libGL/glvnd/Mesa.

Mount libs into /usr/lib/distrobox-nvidia/{lib64,lib32} bucketed by ELF class +
one ld.so.conf, instead of guessing the guest path; 4 mount loops fold into one.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 17:19:21 +02:00
distrobox-docs-bot c08ad8dec7 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-07-25 10:01:22 +00:00
Luca Di Maio 24eeae0f86 test(commands): make generate-all-entries test hermetic
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 11:56:17 +02:00
Luca Di Maio e15c09fe97 Merge pull request #2175 from 89luca89/fix/ci_failures
fix(init): resolve compatibility-matrix container setup failures
2026-07-25 11:55:15 +02:00
Luca Di Maio 1ed078f68a fix(init): mask systemd-tmpfiles rules over host-shared paths
In rootless containers systemd-tmpfiles chowns the bind-mounted /tmp,
/dev and /sys and fails with EPERM, aborting package setup (systemd
>= 261, tpm-udev). Masks those configs.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 11:37:16 +02:00
Luca Di Maio 270bdba514 fix(init): accept zypper informational exit codes on install
zypper returns >= 100 when the transaction committed but a caveat
applies - e.g. 107 when a package %post fails, common in containers.
Only 106 was accepted; warn on the whole band except 105 (a real abort).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 11:36:59 +02:00
Luca Di Maio 7c26238742 fix(init): sync alpine base to the repo before installing
alpine:edge's base image musl can lag the repo, so new package binaries
fail to relocate newer symbols (e.g. renameat2) and their post-install
scripts abort.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 11:36:01 +02:00
Luca Di Maio 9c2ba30891 fix(docs): remove broken distro from compatibility list
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-25 11:32:38 +02:00
Luca Di Maio 1308ae11ce chore(license): add GPL-3.0 SPDX header to Go sources (#2173)
The legacy shell tree carried a per-file license header; the Go rewrite
shipped without one. Add it to all files and enforce it going forward
via golangci-lint's goheader linter, so the notice can't be dropped.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-24 18:08:51 +02:00
Luca Di Maio 64acbeade6 refactor(providers): drop unused InspectImageOutput type
The exported struct was produced and consumed by nothing — no
InspectImage method exists and no caller references it — so it was
dead public surface, not a usable affordance.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-24 14:25:52 +02:00
Luca Di Maio 60103b1da1 refactor(containermanager): use slices.Contains for PATH segment checks
The (:|^)…(:|$) regexes only tested whether a path was an exact
colon-delimited segment — what slices.Contains over strings.Split does
directly, without recompiling a regex on every loop iteration.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-24 14:25:45 +02:00
Luca Di Maio e513cf8d8a refactor(cleanup): remove dead code and duplication (#2172)
* refactor(userenv): drop unreachable UID/GID id-command fallbacks

os.Getuid/os.Getgid only return -1 on Windows, and distrobox is
Linux/macOS only, so the `id -ru`/`id -rg` fallbacks never executed.
Call them directly and drop the now-unused //nolint:gocognit.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* refactor(config): use maps.Copy in mergeConfigMaps

Replace the hand-rolled nested-loop map merge with the stdlib
maps.Copy. Rename the variadic parameter to configMaps so it no
longer shadows the maps package.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* refactor(ephemeral): drop DryRun field shadowing CreateOptions

EphemeralOptions embedded CreateOptions yet redeclared DryRun,
shadowing it. Remove the field and rely on promotion; set DryRun
in the embedded CreateOptions at the call sites instead.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* refactor(create): drop duplicate local --verbose flag

The root command already declares --verbose/-v as a persistent
flag, so create's local copy was redundant. Remove it; -v and
--verbose on `distrobox create` still resolve to the global.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* refactor(containermanager): use time.RFC3339Nano in TimestampNow

Replace the hand-written "…000000000+00:00" layout with the stdlib
RFC3339Nano constant. Output is equivalent RFC3339 (UTC "Z", trailing
zeros trimmed), still valid input for `podman/docker logs --since`.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

---------

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-24 11:01:07 +02:00
balanza 91fc884c26 refactor(config): move the script dir resolution to the global config
So that we centralize all the references to environment configurations
and their defaults
2026-07-21 21:12:04 +02:00
Luca Di Maio 8561affccb fix(enter): parse distrobox flags after the container name (#2165)
`distrobox enter my-box --help` and any distrobox flag placed after the
container name, was passed to the container manager as the command instead
of being parsed, so it failed with a crun error. This diverged from the
original bash distrobox-enter, which keeps parsing flags after the name and
only starts the command at -e/--exec/--.

The port stopped flag parsing at the first positional (StopOnNthArg), which
cannot tell the name from the command: when --name or DBX_CONTAINER_NAME
already supplies the name, the first positional *is* the command. So the
command boundary is resolved before parsing and everything past it is handed
to urfave verbatim, letting flags be recognized wherever they appear while
the custom command is still passed through untouched. ephemeral gets the
same treatment.

Unknown flags after the name are rejected, as in bash, so a mistyped flag
surfaces instead of being silently executed inside the container.

Fixes https://github.com/89luca89/distrobox/issues/2160

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-07-18 17:00:12 +02:00
balanza 17216a5d19 fix(inside-distrobox): do not consider scripts in PATH
The presence of distrobox-init (or -export or -host-exec) in the host PATH must not be considered when checking the
presence of the scripts, the container manager is only considering the
configured host directory as a source for copying the files into a
newly-created container.

An alternative solution could it be to use the location of the file when
the script is detected in PATH. That has been discarded for two reasons:
1. the need to propagate the value of the file location though all the
   usage chain; also, potentially each file can be in different
   locations thus requiring the code to handle them;
2. the scripts in PATH may not be the ones used by the current version
   of Distrobox (think about try out the latest version while having the
   stable one installed on the machine).
2026-07-17 14:28:26 +02:00
NN708 427a626fa7 docs: update vanilla distrobox icon 2026-07-17 11:26:47 +02:00
Alessio Attilio 4c334118a1 fix(init): check if group exists before appending user (#2162) 2026-07-11 16:47:46 +02:00
Alessio Attilio 4c5198d18c fix: ensure rootful containers add user to sudo/wheel group (#2158) 2026-07-11 12:38:52 +02:00
Alessio Attilio 7146d04dfa fix: resolve --version flag conflict with --verbose/-v 2026-07-08 23:19:28 +02:00
distrobox-docs-bot 4bb853db4b Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-07-06 06:23:04 +00:00
Alessio Biancalana fdfb4a1d0e feat(install): support both legacy and v2 in the install script (#2145) 2026-07-06 08:22:22 +02:00
Alessio Biancalana 20e734fbd4 fix: replace --format json with backward-compatible alternatives (#2150) 2026-07-05 23:04:02 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 5849b619d7 chore(deps): bump actions/setup-go from 6.4.0 to 6.5.0 (#2146)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.4.0 to 6.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/4a3601121dd01d1626a1e23e37211e3254c1c06c...924ae3a1cded613372ab5595356fb5720e22ba16)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-01 10:32:36 +02:00
Alessio Biancalana cfc8c6d506 fix: release workflow when release tags already exist (#2144) 2.0.0-rc.3 2026-06-29 20:05:58 +02:00
Emanuele De Cupis 8f243c2715 chore(ci): bundle release (#2141)
The release contains now a bundled directory for every arch, so that in
the bundled directory all the executables for distrobox are included
2026-06-29 19:48:04 +02:00
Luca Di Maio 94ae7fa1ac feat(compat): preserve v1 entry points after v2 single-binary split
v1 containers bind-mount distrobox-{init,export,host-exec} from host
$bindir, and v1 desktop entries launch via `distrobox-enter`. Both
would silently break under v2's single binary. argv[0] dispatch
routes distrobox-* symlinks to the right subcommand, and the helpers
ship at the v1 paths so v1 containers keep working.

BREAKING CHANGE: v2 rc1 and rc2 prerelease containers used ~/.local/share/distrobox/v2/
for their helpers and must be recreated.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-29 15:09:53 +02:00
Luca Di Maio 94d62f5e36 fix(list): scope distrobox detection to known label keys (#2143)
IsDistrobox matched any label key OR value containing "distrobox", so
unrelated containers carrying a path or project tag that happened to
include the substring (e.g. a workdir under a "distrobox" directory)
leaked into `distrobox list` — and into the rm/upgrade/stop pipelines
that filter through the same call.

Label values are never authoritative; only `manager=distrobox` and the
`distrobox.*` key namespace are ever set by us. Check those directly,
keeping 24b31ed8 working for manager-overridden boxes (apx).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-29 14:13:58 +02:00
Luca Di Maio 2fa1339409 Merge pull request #2136 from 89luca89/dependabot/go_modules/gopkg.in/ini.v1-1.67.3
chore(deps): bump gopkg.in/ini.v1 from 1.67.0 to 1.67.3
2026-06-25 16:06:40 +02:00
Luca Di Maio 7d67bdb3d2 Merge branch 'main' into dependabot/go_modules/gopkg.in/ini.v1-1.67.3 2026-06-25 16:06:31 +02:00
Luca Di Maio 566b07d738 Merge pull request #2138 from 89luca89/dependabot/github_actions/golangci/golangci-lint-action-9.2.1
chore(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.2.1
2026-06-25 16:05:44 +02:00
Luca Di Maio 2350c8599f Merge pull request #2137 from 89luca89/dependabot/github_actions/actions/checkout-7.0.0
chore(deps): bump actions/checkout from 6.0.2 to 7.0.0
2026-06-25 16:05:31 +02:00
Luca Di Maio bd8666847b Merge pull request #2135 from 89luca89/dependabot/go_modules/github.com/urfave/cli/v3-3.10.0
chore(deps): bump github.com/urfave/cli/v3 from 3.5.0 to 3.10.0
2026-06-25 16:05:13 +02:00
dependabot[bot] 7aabef8280 chore(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.2.1
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/1e7e51e771db61008b38414a730f564565cf7c20...82606bf257cbaff209d206a39f5134f0cfbfd2ee)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: 9.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:21 +00:00
dependabot[bot] 614014e48d chore(deps): bump actions/checkout from 6.0.2 to 7.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:05 +00:00
dependabot[bot] f4e9b862a8 chore(deps): bump gopkg.in/ini.v1 from 1.67.0 to 1.67.3
Bumps gopkg.in/ini.v1 from 1.67.0 to 1.67.3.

---
updated-dependencies:
- dependency-name: gopkg.in/ini.v1
  dependency-version: 1.67.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:04 +00:00
distrobox-docs-bot a193355609 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-06-25 13:55:02 +00:00
dependabot[bot] 44e598c3a5 chore(deps): bump github.com/urfave/cli/v3 from 3.5.0 to 3.10.0
Bumps [github.com/urfave/cli/v3](https://github.com/urfave/cli) from 3.5.0 to 3.10.0.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v3.5.0...v3.10.0)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v3
  dependency-version: 3.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:02 +00:00
Luca Di Maio 7fe1539076 Merge pull request #2122 from 89luca89/next
feat: distrobox v2.0
2026-06-25 15:54:13 +02:00
Alessio Biancalana c7478fdf5f fix: forbidigo on completion stdout writes 2026-06-25 14:27:15 +02:00
Luca Di Maio 8d96cce479 docs: switch usage and man pages to v2 subcommand syntax
Rewrite distrobox-*.md to `distrobox <cmd>`, reconcile flag tables with
internal/cli, refresh README+useful_tips, regenerate man/man1/*.1.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio a4d2217a57 feat(install): make install/uninstall scripts work with v2
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio 4acf784a7d feat(completion): add bash and zsh shell completion
Wrappers in completions/ call --generate-shell-completion; a Go
ShellComplete callback emits flag names so urfave's default response
(subcommands only) is replaced with the full candidate set.

This replaces old hard-coded way to auto-complete using shell script's
parsing.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio c71075124b chore(commands): tidy error paths and drop v1-comparability code
Fix "contaiers" typo (list, rm), route the upgrade error through the
printer, and simplify joinHooks now that tests/compare.sh is gone.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio b31ea49e91 chore(cleanup): remove v1 file leftovers
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00