Commit Graph
1811 Commits
Author SHA1 Message Date
Emanuele De Cupis cfb8ab06de feat(assemble): implement create with assemble (#20)
* scaffold assemble command

* mount assemble command

* implement create item
2026-06-14 13:04:27 +02:00
Emanuele De Cupis 3ba0ba350c fix: increase since timestamp at every iteration (#22) 2026-06-14 13:04:27 +02:00
Emanuele De Cupis 5930201257 fix(create): fix argument passing (#21) 2026-06-14 13:04:27 +02:00
Emanuele De Cupis d1308fda97 fix(assemble): refine manifest item type (#19)
* remove unused ID field

* add a test for include order
2026-06-14 13:04:27 +02:00
Emanuele De Cupis 16ceec4dc2 feat(create): generate desktop entry on create (#17)
* read desktop entry directory and distrobox path from the global config

* implement entry generation requested from user
2026-06-14 13:04:17 +02:00
Emanuele De Cupis 04d3d006fb feat: parse manifest files (#18) 2026-06-14 12:58:04 +02:00
Alessio Biancalana d92dfe2f5c feat(enter): rewrite in go (#12)
* feat(enter): rewrite in go

* chore: make InspectContainer public

* chore: use userenv package for user's environment

* chore: export InspectResult type for convenience

* fix: rename containerInspect to inpectOutput

* fix: use userenv inside generateEnterCommand

* fix(enter): more userenv

* chore: add some unit tests for buildContainerPath and buildCommandArgs
2026-06-14 12:58:04 +02:00
Fabrizio Sestito a2c0508641 feat: add config (#15)
* feat: add config

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* build(deps): add testify

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* test(config): add config loading test

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 12:58:04 +02:00
Emanuele De Cupis ed9692fc1c chore: refactor run (#16) 2026-06-14 12:58:04 +02:00
Emanuele De Cupis 6ce7bf6cc6 feat: create command (#14)
* embed shell scripts to execute inside the distrobox

The command init, export and host-exec must be accessible from inside
the distrobox container.
When needed, the embedded scripts will be written to a host directory
and then mounted as volume on the created container.
The host directory is determined by configuration and environment
variables.
The script will be not converted to GO to keep then
architecture-agnostic.

* add Create to the Docker container manager

The function will compose argument string to append to the `docker`
command.
If `DryRun=true`, the command is just printed on screen and not
executed.

* add Create command package

* mount cli command
2026-06-14 12:58:04 +02:00
Alessio Biancalana 91ae6568e0 fix: generate-entry tests against new docker interface (#13) 2026-06-14 12:58:04 +02:00
Emanuele De Cupis 4a7d83bfe7 feat: generate-entry command (#7)
* add GenerateEntryCommand package

The package mimics the actual distrobox-generate-entry shell command
that installs a desktop entry file so that the host's desktop
environment can render the appropriate application icon.
This first implementantion scaffolds the command package and implements
the simplest scenario for a single container.

* delete entry

If the `delete` flag is provided, the command remove the desktop entry
if present.
Deleting a non-existing item does not raise an error.

* generate entries for all containers

With `opts.All` we implement an abstraction over the
`GenerateEntryCommand` that iterates across all the containers to
generate or delete the relative desktop entries.
`ListCommand` is used to fetch the list of containers.

* mount the generate-entry cli command

Mount the command so that is reachable from the CLI. Define parameters
with type and basic validation.
Depending on the flag `--all`, the appropriate set of options is provided
to the `GenerateEntryCommand.Execute()` method.
If `--all` is set, `container-name` and `icon` arguments will be ignored.
2026-06-14 12:58:04 +02:00
Fabrizio Sestito d81390bd73 feat: validate sudo before command (#10)
* feat(cli): validate sudo (sudo -v) in beforeCommand if --root is set

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat(docker): add root and sudoCommand and execute commands with sudo if root is set

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat(cli): add --root description and -r alias

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 12:58:04 +02:00
dependabot[bot] 0e67950c32 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-14 12:58:04 +02:00
Emanuele De CupisandAlessio Biancalana bf8a6f8870 chore: add ci for rewrite project (#9)
* chore: disable mdlint (#6)

* resolve lint issues

Some issues where detected by the CI once run:
* use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
* File is not properly formatted (goimports)
* Magic number: 12, in <condition> detected (mnd)
* error-format: fmt.Errorf can be replaced with errors.New (perfsprint)

---------

Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-06-14 12:58:04 +02:00
Emanuele De Cupis 4547c5eb2a chore: add rfc 0001 for golang rewrite (#5) 2026-06-14 12:58:04 +02:00
Emanuele De Cupis c74e9144b4 fix: formatting (#8) 2026-06-14 12:57:57 +02:00
Alessio Biancalana 61a706a285 chore: disable mdlint (#6) 2026-06-11 18:24:39 +02:00
Fabrizio Sestito 1f5c3c3441 feat: add basic cli and list command (#4)
* feat: add containermanager package and docker provider

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add list command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add root command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add list command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: wire-up root command in main

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* refactor(docker): use format json

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-11 18:24:39 +02:00
Fabrizio Sestito e18f7abec7 chore(rewrite): project scaffolding (#3)
* build(deps): add urfave/cli

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* chore: add gitignore

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* ci: add golangci configuration

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* build(Makefile): add Makefile

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add main package and distrobox cmd

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-11 18:24:39 +02:00
Fabrizio Sestito e4327dab0b chore: go mod init rewrite
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-11 18:24:39 +02:00
distrobox-docs-bot 964099b8ce Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-05-27 13:19:31 +00:00
bochechaandMathieu Bridon bb97275aa4 docs: add Fedora 44 to supported images (#2120)
Taken from quay.io as were the other ones.

Co-authored-by: Mathieu Bridon <bochecha@daitauha.fr>
2026-05-27 15:18:50 +02:00
fiftydinar 353bc410b9 fix(init): Replace remaining non-POSIX echo -e with printf (#2114) 2026-05-25 15:51:41 +02:00
distrobox-docs-bot 34b769ed26 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-05-09 09:28:50 +00:00
DrSheppard 1345aff08e docs: add columns parameter for better style packaging status (#2095)
[Docs] Add columns parameter for better style packaging status
2026-05-09 11:28:09 +02:00
Fred Fu 892f93baaa fix: flags for read-only and recursive slave mount (#2086)
closes #2083
2026-05-04 11:10:30 +02:00
distrobox-docs-bot 46d046b095 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-04-28 06:42:27 +00:00
LinuxJourney 12fa480b65 docs: add docker.io/library/ubuntu:26.04 as a working container (#2076) 2026-04-28 08:41:46 +02:00
Alessio Biancalana 40c3cd724f chore: bump to v1.8.2.5 (#2072) 1.8.2.5 2026-04-27 14:25:31 +02:00
Alessio BiancalanaandDaniel Lindenfelser 1965abe68c fix(enter): correct order for su commands in unshare-groups (#2067)
The unshare_groups variable was previously read from a container label
only after the positional-parameter manipulation that decides whether
to wrap the command in `su`. As a result, containers labeled with
distrobox.unshare_groups=1 (e.g. ubi-init images) were entered as root
instead of the host user.

Read the label early via a dedicated lightweight inspect, so the
wrapping logic sees the correct value. The full container inspect
remains in its original position to preserve the existing behavior
when the container does not exist yet.

Also fix the `su` argument order in the unshare_groups branch: POSIX
`su` requires options before the username, and the previous code passed
a stray `--` literal that broke the wrapping shell snippet.

The `su` invocation also needed a literal `--` between options and the
username: util-linux `su` uses GNU getopt with argument reordering, so
without `--` any flag-looking argument in the user's command (e.g.
`uname -n`) is parsed as a `su` option and rejected.

Fixes #2011

Co-authored-by: Daniel Lindenfelser <daniel@lindenfelser.de>
2026-04-27 14:10:56 +02:00
Yiming Sun 87a2442c85 enter: fix su argument order in unshare_groups path (#2055) 2026-04-22 14:10:45 +02:00
Edoardo Dusi a426ffc764 init: also clean empty unversioned .so stubs during nvidia setup (#2024)
The existing cleanup pattern `*.so.*` only matches versioned libraries
(e.g. libcuda.so.1) but misses unversioned stubs (e.g. libcuda.so,
libnvcuvid.so). After a driver upgrade, these remain as empty 0-byte
files and are not overwritten by the subsequent bind-mounts, which only
mount the versioned files. Applications that dlopen the unversioned name
(like DaVinci Resolve for CUDA) load the empty file and silently fall
back to OpenCL.

Widen the glob to `*.so*` so that both versioned and unversioned empty
stubs are removed before the host driver libraries are mounted.

Fixes #1764
2026-04-10 17:29:16 +02:00
Emanuele De Cupis 324f6fedac docs: issue template notice for distrobox v2 (#2049) 2026-04-02 15:04:30 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> a558b1799e build(deps): bump actions/setup-go from 5 to 6 (#2042)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:56:22 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2f58da4002 build(deps): bump actions/download-artifact from 4 to 8 (#2043)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:56:07 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 40650e45f5 build(deps): bump actions/upload-artifact from 4 to 7 (#2044)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 10:42:34 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> b7ce71b14d build(deps): bump actions/checkout from 4 to 6 (#2045)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [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/v4...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 10:42:21 +02:00
Luca Di Maio cbf6a99ff6 Fix DOCS links
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-03-30 15:57:55 +02:00
6155b5e33e docs(posts): announcing Distrobox v2 (#2032)
* docs(posts): announcing v2 post

Co-authored-by: 89luca89 <luca.dimaio1@gmail.com>
Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
Co-authored-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* docs(posts): distrobox next architecture

Co-authored-by: 89luca89 <luca.dimaio1@gmail.com>
Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
Co-authored-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* docs: fix link to distrobox next architecture

---------

Co-authored-by: 89luca89 <luca.dimaio1@gmail.com>
Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
Co-authored-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-03-29 18:47:14 +02:00
Emanuele De Cupis 02da184062 chore(ci): v2 release candidate workflow (#2031) 2026-03-28 15:09:55 +01:00
Luca Di Maio c6cc6a3d5b init: chmod shadow files to 0400 for container storage compatibility (#2020)
On container storage drivers where CAP_DAC_OVERRIDE is not effective
(e.g. fuse-overlayfs in rootless mode, or VMs like Docker Desktop /
Colima on macOS), root cannot read files with mode 000 despite having
the capability in its effective set. This causes pam_unix.so account
management to fail with "Authentication service cannot retrieve
authentication info" when calling getspnam(), because glibc's NSS
files backend cannot open /etc/shadow.

Fedora and Arch ship /etc/shadow and /etc/gshadow as mode 000, relying
on CAP_DAC_OVERRIDE to grant root access. Set them to 0400 (owner-read)
after password setup so that standard POSIX owner checks suffice.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-03-19 14:42:55 +01:00
distrobox-docs-bot 68990f5486 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-03-19 10:54:08 +00:00
Eric Curtin 4e3dbe5b9a all: add Docker Desktop on macOS compatibility (#2019)
On macOS, Docker Desktop mounts all paths as private (rprivate) in its
Linux VM via VirtioFS, so rslave/rshared bind propagation is rejected.
Strip these propagation options from the generated docker create command
when running on Darwin.

Also fix a bug in distrobox-init where the socket path prefix stripping
used `sed 's|/run/host||g'` with the global flag, causing paths like
`/run/host/run/host-services/ssh-auth.sock` (a Docker Desktop socket)
to be mangled into `-services/ssh-auth.sock`. The leading `-` was then
parsed as a flag by `rm`, crashing the init script. Replace with shell
parameter expansion `${host_socket#/run/host}` which strips the prefix
exactly once.

distrobox-init detects "rootful" mode by checking if /run/host/etc/shadow
is accessible and owned by root. On macOS with Docker Desktop, all containers
run as root inside the Linux VM, so this check always succeeds even for
containers created without --root, causing a spurious first-shell password
prompt.

Fix this by having distrobox-create mount /dev/null:/run/.distrobox.rootless:ro
for every rootless container. distrobox-init now checks for this marker first
and skips the shadow heuristic when it is present.

This is backward-compatible: existing containers without the marker continue
to use the shadow-file heuristic as before.

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
2026-03-19 11:53:26 +01:00
Daniel Tang 3e49b78712 fix: Pass -xdev to /bin/find (#1998)
I had mounted my Docker at `/run/home/docker`. Docker then mounted my
home folder somewhere under an overlayfs folder there. Distrobox had
appeared frozen at "Setting up host's sockets integration..." as it
tried to traverse my entire home directory on a slow hard disk.

No relevant socket was found on any submount, so excluding the submounts
should be OK.
2026-03-03 10:53:12 +01:00
Andrey A. Limachko fd1a0da78d feat: add ALT Linux compatibility improvements (#1989)
* fix: use mkdir -p to prevent error on existing user tcb directory

Use mkdir -p in setup_aptrpm() to prevent command failure if
/etc/tcb/$user already exists.

Signed-off-by: Andrey Limachko <liannnix@altlinux.org>

* fix: disable pam_mktemp for PAM stack compatibility

Private tmp directory is not needed as /tmp is mounted from host system.
Using pam_mktemp would break the PAM stack.

Signed-off-by: Andrey Limachko <liannnix@altlinux.org>

* fix: ALT Linux --init compatibility via runuser wrapper

ALT Linux ships its own su(1) implementation incompatible with util-linux
su flags. distrobox-enter passes -m, --pty, -s, -c when unshare_groups is
enabled (--init containers). These flags are rejected by ALT's su, causing
instant failure.

Add /usr/local/bin/su wrapper that delegates to /usr/sbin/runuser (from
util-linux, always present in ALT). The wrapper is placed in /usr/local/bin
to survive package updates, and the existing generic --pty-stripping wrapper
is guarded to not overwrite it.

Fix PATH ordering in distrobox-enter to ensure /usr/local/bin precedes
/usr/bin when host PATH is passed through. This follows FHS conventions
and guarantees the wrapper is found first.

Signed-off-by: Andrey Limachko <liannnix@altlinux.org>

---------

Signed-off-by: Andrey Limachko <liannnix@altlinux.org>
2026-03-03 10:11:21 +01:00
Gerhard de ClercqandAlessio Biancalana 4f86c35af7 docs: update README with sandboxing alternatives (#2009)
* Update README with sandboxing alternatives

Added information about alternatives to Distrobox with sandboxing capabilities.

* Fix docs/README.md typo

Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>

---------

Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-02-27 17:50:53 +01:00
dannyhpy 21afad192b init: zypper: use drop-in config file if possible (#2007)
In openSUSE Tumbleweed, the /etc/zypp/zypp.conf is not present by
default anymore. The documentation[1] now suggests to maintain the
configuration using drop-in files in /etc/zypp/zypp.conf.d/

[1] https://manpages.opensuse.org/Tumbleweed/libzypp/zypp.conf.5.en.html
2026-02-24 08:49:48 +01:00
Emanuele De Cupis 7ad55d00d1 fix: expose correct dryrun command (#2006) 2026-02-22 18:20:27 +01:00
Emanuele De Cupis 0424e15a2a enter: show container command on dry run (#2000)
This fix ensures that the printed command in dry-run mode is the same
as the one that would be executed without the --dry-run flag.

The container command, either default or custom, is always appended to
the command in both normal and dry-run execution.

The inspect command to fetch the container status is now executed only
when not in dry-run mode.
2026-02-18 10:00:43 +01:00