зеркало из
https://github.com/iharh/notes.git
synced 2025-10-30 05:06:05 +02:00
185 строки
6.3 KiB
Plaintext
185 строки
6.3 KiB
Plaintext
https://distrobox.it/usage/usage/
|
|
|
|
/usr/bin/distrobox
|
|
/usr/bin/distrobox-assemble
|
|
https://distrobox.it/usage/distrobox-create/
|
|
--clone/-c
|
|
--compatibility/-C:
|
|
show list of compatible images
|
|
|
|
quay.io/fedora/fedora:40
|
|
registry.fedoraproject.org/fedora-toolbox:40
|
|
???
|
|
docker.io/library/ubuntu:24.04
|
|
--home/-H:
|
|
select a custom HOME directory for the container. Useful to avoid host's home littering with temp files.
|
|
--additional-packages/-ap:
|
|
additional packages to install during initial container setup
|
|
--init/-I:
|
|
use init system (like systemd) inside the container.
|
|
this will make host's processes not visible from within the container. (assumes --unshare-process)
|
|
--dry-run/-d:
|
|
only print the container manager command generated (podman run command for creating container)
|
|
--verbose/-v:
|
|
show more verbosity
|
|
|
|
samples
|
|
distrobox create -i quay.io/fedora/fedora:40 -n fedora40 -H ~/distrobox/fedora40 -ap "systemd" -I -a NET_ADMIN -a NET_RAW -d
|
|
|
|
-v
|
|
--additional-flags
|
|
"--env MY_VAR=value"
|
|
"--pids-limit -1"
|
|
--volume /opt/my-dir:/usr/local/my-dir:rw
|
|
--pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
|
|
--init-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
|
|
!!!
|
|
Error: Unable to find a match: libpam-systemd pipewire-audio-client-libraries
|
|
!!!
|
|
https://distrobox.it/usage/distrobox-enter/
|
|
...
|
|
--no-workdir/-nw:
|
|
always start the container from container's home directory
|
|
--additional-flags/-a:
|
|
additional flags to pass to the container manager command
|
|
--/-e:
|
|
end arguments execute the rest as command to execute at login
|
|
...
|
|
enter "fedora1"
|
|
|
|
Starting container... [ OK ]
|
|
--- ??? ---
|
|
Installing basic packages... [ OK ]
|
|
Setting up devpts mounts... [ 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 distrobox profile... [ OK ]
|
|
Setting up sudo... [ OK ]
|
|
Setting up kerberos integration... [ OK ]
|
|
Setting up user's group list... [ OK ]
|
|
Setting up existing user... [ OK ]
|
|
Ensuring user's access... [ OK ]
|
|
Setting up skel... [ OK ]
|
|
Setting up init system... [ OK ]
|
|
Firing up init system... [ OK ]
|
|
---
|
|
Container Setup Complete!
|
|
|
|
generate_enter_command() {
|
|
...
|
|
|
|
# Start with the $PATH set in the container's config
|
|
container_paths="${container_path:-""}"
|
|
# Ensure the standard FHS program paths are in PATH environment
|
|
standard_paths="/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin"
|
|
|
|
if [ "${clean_path}" -eq 1 ]; then
|
|
...
|
|
else
|
|
...
|
|
fi
|
|
...
|
|
}
|
|
...
|
|
# dry run mode, just generate the command and print it. No execution.
|
|
if [ "${dryrun}" -ne 0 ]; then
|
|
cmd="$(generate_enter_command | sed 's/\t//g')"
|
|
printf "%s %s\n" "${cmd}" "$*"
|
|
exit 0
|
|
fi
|
|
|
|
/usr/bin/distrobox-ephemeral
|
|
/usr/bin/distrobox-export
|
|
distrobox-export --app kate
|
|
create desktop-file on a host system for guest app launcher
|
|
distrobox-export --bin /usr/bin/kate --export-path ~/local/bin/
|
|
! actually - broken
|
|
https://distrobox.it/usage/distrobox-generate-entry/
|
|
--delete/-d:
|
|
delete the entry
|
|
--verbose/-v:
|
|
show more verbosity
|
|
|
|
samples
|
|
distrobox generate-entry fedora40 -v
|
|
|
|
cat ~/.local/share/applications/fedora40.desktop
|
|
[Desktop Entry]
|
|
Name=Fedora40
|
|
GenericName=Terminal entering Fedora40
|
|
Comment=Terminal entering Fedora40
|
|
Categories=Distrobox;System;Utility
|
|
Exec=/usr/bin/distrobox enter fedora40
|
|
Icon=/home/iharh/.local/share/icons/distrobox/fedora.png
|
|
Keywords=distrobox;
|
|
NoDisplay=false
|
|
Terminal=true
|
|
TryExec=/usr/bin/distrobox
|
|
Type=Application
|
|
Actions=Remove;
|
|
|
|
[Desktop Action Remove]
|
|
Name=Remove Fedora40 from system
|
|
Exec=/usr/bin/distrobox rm fedora40
|
|
/usr/bin/distrobox-host-exec
|
|
https://distrobox.it/posts/execute_commands_on_host/
|
|
/usr/bin/distrobox-init
|
|
INIT_BINS="
|
|
/sbin/init
|
|
/usr/sbin/init
|
|
/lib/systemd/systemd
|
|
/usr/lib/systemd/systemd
|
|
/usr/bin/distrobox-list
|
|
/usr/bin/distrobox-rm
|
|
/usr/bin/distrobox-stop
|
|
/usr/bin/distrobox-upgrade
|
|
/usr/bin/distrobox-list
|
|
/usr/bin/distrobox-stop
|
|
/usr/bin/distrobox-rm
|
|
|
|
|
|
|
|
/usr/bin
|
|
distrobox
|
|
distrobox-assemble
|
|
distrobox-create
|
|
distrobox-enter
|
|
distrobox-ephemeral
|
|
distrobox-export
|
|
distrobox-generate-entry
|
|
distrobox-host-exec
|
|
distrobox-init
|
|
distrobox-list
|
|
distrobox-rm
|
|
distrobox-stop
|
|
distrobox-upgrade
|
|
|
|
|
|
/usr/bin/distrobox-list
|
|
...
|
|
# List containers using custom format that included MOUNTS
|
|
# we do this as we can detect the custom mounts done by distrobox to distringuish
|
|
# between a normal container and a distrobox one.
|
|
container_list=$(${container_manager} ps -a --no-trunc --format \
|
|
"{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}|{{.Labels}}{{.Mounts}}")
|
|
...
|
|
podman ps -a --no-trunc --format "{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}|{{.Labels}}{{.Mounts}}"
|
|
|
|
/usr/bin/distrobox-create
|
|
...
|
|
# inject additional volumes if specified
|
|
if [ -n "${container_additional_volumes}" ]; then
|
|
for volume in ${container_additional_volumes}; do
|
|
container_manager_additional_flags="${container_manager_additional_flags}
|
|
--volume ${volume}"
|
|
done
|
|
fi
|
|
...
|
|
--volume /tmp:/tmp:rslave
|
|
--volume \"${distrobox_entrypoint_path}\":/usr/bin/entrypoint:ro
|
|
--volume \"${distrobox_export_path}\":/usr/bin/distrobox-export:ro
|
|
--volume \"${distrobox_hostexec_path}\":/usr/bin/distrobox-host-exec:ro
|
|
--volume \"${container_user_home}\":\"${container_user_home}\":rslave"
|