Commit Graph
443 Commits
Author SHA1 Message Date
89luca89 2ace0e4e73 distrobox: add support for rootful containers
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>
2022-05-01 08:03:03 +02:00
89luca89 741248e831 list: add -s/--size option to show container disk usage 2022-04-28 14:15:19 +02:00
89luca89 41da4f54a2 all: bump version for next release 2022-04-28 12:28:40 +02:00
89luca89 e760a489af enter: extract container SHELL from inspect, use that as fallback if no custom command provided #227 1.2.15 2022-04-28 11:32:20 +02:00
89luca89 7f9fcdc449 CI: disable systemd checks for now, it seems incompatible with runner-provisioner.service on github 2022-04-27 20:44:38 +02:00
Michal Vyskocil 09d48041dc enter: fix unbound variable with --dry-run (#244)
The --dry-run switch for enter command fails with

```
DISTROBOX_ENTER_PATH=/usr/bin/distrobox-enter"'
++ set +o xtrace
/usr/bin/distrobox-enter: line 279: container_PATH: unbound variable
```

generate_command expects container_PATH to be declared, so move the
variable declaration slightly upper fixes the problem.
2022-04-27 17:48:00 +02:00
89luca89 81966c3bbf init: exclude dbus system socket sharing, it doesn't work and creates confusing error messages, Fix #246 2022-04-27 16:44:44 +02:00
89luca89 d1735507cc init: add pacman post-hook to neutralize systemd post-hooks in case we're not in an init-enabled container 2022-04-26 11:23:44 +02:00
89luca89 ba1f783f7b create: add work around for incompatibility between systemd/journald ACLs and overlayfs, Fix #243 2022-04-25 21:32:38 +02:00
89luca89 466fba10d1 CI: add bashate to linters 2022-04-25 12:30:52 +02:00
89luca89 e2d3fe2db7 all: formatting and readability fixes 2022-04-25 12:30:42 +02:00
89luca89 4c1556fc15 enter: check for container errors during first start, Fix #242 2022-04-25 12:28:43 +02:00
89luca89 458eeb22d1 docs: add more compatibility notes 2022-04-19 11:25:39 +02:00
89luca89 1acc861b52 export: hide unuseful stderr in export 2022-04-19 11:01:11 +02:00
bam80 fa2532ff83 docs: update README.md (#239)
fix broken links
2022-04-18 22:12:26 +02:00
bam80 6990a5e1af docs: update run_latest_gnome_kde_on_distrobox.md (#238)
fix broken links
2022-04-18 22:12:00 +02:00
bam80 20f086c50a docs: update run_latest_gnome_kde_on_distrobox.md (#234)
it's called Plasma, not KDE
2022-04-16 22:59:53 +02:00
bam80 038f6ed95a docs: update run_latest_gnome_kde_on_distrobox.md (#233)
Place .desktop files to /usr/local/..
2022-04-16 22:59:26 +02:00
maiki eac6d9d713 docs: fix typos (#232) 2022-04-13 17:54:52 +02:00
89luca89 bf7c0ba556 CI: add markdownlint to Lint job 2022-04-05 18:21:37 +02:00
89luca89 ac320cc40a docs: update and format docs 2022-04-05 17:12:42 +02:00
89luca89 f1ed2c50a3 enter: fix boolean logic on tty use 2022-04-04 22:23:35 +02:00
89luca89 e6f41a3fd3 create/enter: print error messages only when not in dry-run 2022-04-04 22:23:35 +02:00
89luca89 8a8288b963 docs: update docs 2022-04-04 22:23:34 +02:00
Nathan Chancellor e6342a05c3 init: Allow all package manager checks to run (#224)
distrobox-init checks for three directories to make decisions based on
what package manager is being used in the following order:

/usr/lib/rpm/macros.d
/etc/dpkg/dpkg.cfg.d
/usr/share/libalpm/scripts

The problem is that a user might have the first two directories on Arch
Linux if they have installed the "rpm-tools" and "dpkg" packages
respectively.  While that seems odd on the surface, these tools are
useful for building packages for "rpm" or "dpkg"-based distributions on
Arch Linux, such as the Linux kernel, which has "bindeb-pkg" and
"binrpm-pkg" targets to build a .deb and .rpm package respectively,
which does not require a Debian or Fedora host. As a result of the "rpm"
and "dpkg" directories being checked first, the third else if clause
never gets executed in the scenario described above.

Instead of making all these if statements mutually exclusive, allow them
all to be run, which should not impact anything during runtime, as only
one package manager will actually be used within the container. Arch
Linux explicitly notes this when installing the "dpkg" and "rpm-tools"
packages:

https://github.com/archlinux/svntogit-community/blob/55c1554978e24cdc5c53d1265a211e5c9dc72a0b/trunk/dpkg.install
https://github.com/archlinux/svntogit-community/blob/13188cb24c4c2ee318f1efad3281e44c6516fde1/trunk/rpm-tools.install

While here, add a comment similar to the other checks.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2022-04-01 22:24:46 +02:00
89luca89 6ca497a1b5 init: fix missing check before umounting 2022-04-01 09:52:22 +02:00
89luca89 bd321ab743 init: improve arch linux integration
Introduce pacman pre and post transaction hooks, like with apt we can
now umount the read-only mounts from the host, and remount them at the
end of the transaction.
This ensures that we are less likely to find error in transactions not
expecting to find those paths as read-only.
Like with rpm and dpkg, we also overwrite the scripts at each init, so
that future changes in mounts will be reflected after a container stop
and restart.
2022-04-01 09:49:14 +02:00
89luca89 7541b7291f init: fix regression introduced in 3f014de239
Mounting also /run/systemd/system from host, will trick the systemd
package inside the container to think that the system is booted with
systemd (really just the presence of the path /run/systemd/system will
be sufficient).

Revert the mounting of this path, and document where this is needed.
This also fixes #222
2022-04-01 09:47:07 +02:00
89luca89 d888316f39 docs: update docs
include badge for latest available releases on various distros
thanks to all the package maintainers!
Include a warning for rootful docker usage as discussed on #201
2022-03-31 13:05:11 +02:00
89luca89 b80eeab14b CI: always pull images before using distrobox 2022-03-30 14:34:27 +02:00
89luca89 82ec8b9881 Lint: use single tools instead of importing an action; reformat all to follow the style 2022-03-30 11:05:21 +02:00
89luca89 6bd8ac3d5b init: fix new archlinux mount: /usr/lib/libmount.so.1: version MOUNT_2_38 not found (required by mount) error, upgrade before installing packages 2022-03-29 16:47:25 +02:00
Dario Faggioli e7d29a6e5d docs: update host-distro instruction for openSUSE Tumbleweed and MicroOS (#218) 2022-03-29 16:00:04 +02:00
89luca89 45b3fa392b CI: show container logs in case of failure 2022-03-25 21:31:56 +00:00
Luca Di Maio b22b3d28f5 create/CI: fix compatibility with init containers (#216)
* Fix compatibility with init containers
Fix #215

Right now systemd integration works only on docker, on podman it will
fail.
This is because docker daemon, running as root, has access to
/sys/fs/cgroup, while podman (rootless) does not.
Podman has a functionality to set up cgroups so that they work in
rootless mode as explained here: https://www.redhat.com/sysadmin/improved-systemd-podman

Right now the system is not triggered because it only checks if
entrypoint are `/sbin/init` or `/usr/bin/systemd`.

To fix this, let's force the use of systemd mode on podman if we're
using `--init`.

This problem went also undetected on the new CI as the `init` images are
tested as normal images. Let's also fix this and test create/enter on
init images using systemd commands.
2022-03-25 21:19:02 +01:00
89luca89 514f60d5d0 enter: do not instantiate a tty if we do not have one 2022-03-25 12:38:27 +00:00
89luca89 a1b3b9c800 docs: update overlayfs docs 2022-03-20 21:25:43 +00:00
89luca89 62089807b0 all: bump version for next release 2022-03-20 14:22:24 +00:00
Luca Di Maio 72035630a5 support environment variables to change defaults (#207)
* support environment variables to change defaults
* CI: test both podman and docker using new ENV variable

Implement use of environment variables to change defaults like:

 - container manager
 - default image to use
 - default name to use
 - interactivity

Variables will be respectively:

- DBX_CONTAINER_MANAGER
- DBX_CONTAINER_IMAGE
- DBX_CONTAINER_NAME
- DBX_NON_INTERACTIVE

This work opens also support for configuration rc-style files, in order of 
importance:

- /usr/share/distrobox/distrobox.conf
- /etc/distrobox/distrobox.conf
- ${HOME}/.config/distrobox/distrobox.conf
- ${HOME}/.distroboxrc
1.2.14
2022-03-20 15:08:30 +01:00
Gerald BrittonandGerald Britton 0bbfcf6631 fix: use container's $PATH when entering (#209)
The PATH fixes in 6b60c73999 use the
host's $PATH instead of the $PATH defined in the container.  This
change fixes that by inspecting the container and parsing $PATH
out of its environment.  The inspect was already being done so
this shouldn't be a signficiant performance impact.  Future
features may desire further information out of the inspect
invocation and the parsing method can be extended.

The container's $PATH is merged with the host $PATH and the
standard set of binary paths as the existing logic uses.

Co-authored-by: Gerald Britton <gbritton@sekrit.org>
2022-03-20 10:16:13 +01:00
89luca89 8d1aad6efa pages: use slate theme 2022-03-17 20:29:54 +00:00
89luca89 98dd45cd06 docs: update TOC in README 2022-03-17 19:32:49 +00:00
89luca89 b38643c298 docs: add more usage examples and tips 2022-03-17 19:30:07 +00:00
89luca89 bf89f72708 export: support exporting of system flatpaks and document it, Fix #171 2022-03-17 19:14:31 +00:00
89luca89 ad100631f1 docs: regorganize TOC in README 2022-03-17 19:13:43 +00:00
89luca89 8d8109913c docs: document ssh x forwarding, fix #172 2022-03-17 18:40:52 +00:00
89luca89 8c9fa3186d docs: update docs and man 2022-03-17 18:35:07 +00:00
89luca89 ddc33170be docs: better specify security implications of distrobox 2022-03-17 18:31:27 +00:00
89luca89 3f014de239 init: tighter systemd integration with host 2022-03-17 18:15:24 +00:00
Luca Di Maio cd2f2c69dd Support LDAP/AD mail usernames (#205)
* Support LDAP/AD mail usernames

sometimes usernames can be in mail form or containing special chars,
this commit will force the creation of the user and group even if it has
invalid names.
2022-03-17 19:04:53 +01:00