mirror of
https://github.com/89luca89/distrobox.git
synced 2025-02-25 18:55:25 -06:00
@@ -106,7 +106,7 @@ done
|
||||
# as it's meaningless for this use case.
|
||||
if [ "${container_user_uid}" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
|
||||
@@ -83,10 +83,10 @@ for config_file in ${config_files}; do
|
||||
done
|
||||
# If we're running this script as root -- as in, logged in in the shell as root
|
||||
# user, and not via SUDO/DOAS --, we don't need to set distrobox_sudo_program
|
||||
# as it's meaningless for thi use case.
|
||||
# as it's meaningless for this use case.
|
||||
if [ "$(id -ru)" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
@@ -324,7 +324,7 @@ generate_command() {
|
||||
# Loop through all the environment vars
|
||||
# and export them to the container.
|
||||
set +o xtrace
|
||||
# disable logging fot this snippet, or it will be too talkative.
|
||||
# disable logging for this snippet, or it will be too talkative.
|
||||
for i in $(printenv | grep '=' | grep -Ev ' |"|`|\$' |
|
||||
grep -Ev '^(HOST|HOSTNAME|HOME|LANG|LC_CTYPE|PATH|SHELL|XDG_.*_DIRS|^_)'); do
|
||||
# We filter the environment so that we do not have strange variables,
|
||||
|
||||
@@ -202,7 +202,7 @@ if [ -z "${exported_app}" ] &&
|
||||
printf >&2 "Error: Invalid arguments.\n"
|
||||
printf >&2 "Error: missing export target. Run\n"
|
||||
printf >&2 "\tdistrobox-export --help\n"
|
||||
printf >&2 "for more informations.\n"
|
||||
printf >&2 "for more information.\n"
|
||||
exit 2
|
||||
fi
|
||||
# Ensure we're not receiving more than one action at time.
|
||||
@@ -244,7 +244,7 @@ else
|
||||
start_shell=""
|
||||
fi
|
||||
|
||||
# Prefix to add to an existing command to work throught the container
|
||||
# Prefix to add to an existing command to work through the container
|
||||
container_command_prefix="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- ${start_shell} "
|
||||
if [ -z "${exported_app_label}" ]; then
|
||||
exported_app_label=" (on ${container_name})"
|
||||
@@ -354,7 +354,7 @@ export_application() {
|
||||
[ -d "${HOME}/.local/share/applications" ] && canon_dirs="${canon_dirs} ${HOME}/.local/share/applications"
|
||||
|
||||
# In this phase we search for applications to export.
|
||||
# First find command will grep throught all files in the canonical directories
|
||||
# First find command will grep through all files in the canonical directories
|
||||
# and only list files that contain the $exported_app, excluding those that
|
||||
# already contains a distrobox-enter command. So skipping already exported apps.
|
||||
# Second find will list all files that contain the name specified, so that
|
||||
@@ -442,11 +442,11 @@ export_application() {
|
||||
continue
|
||||
fi
|
||||
|
||||
# Add commmand_prefix
|
||||
# Add command_prefix
|
||||
# Add extra flags
|
||||
# Add closing quote
|
||||
# If a TryExec is present, we have to fake it as it will not work
|
||||
# throught the container separation
|
||||
# through the container separation
|
||||
sed "s|^Exec=|Exec=${container_command_prefix} |g" "${desktop_file}" |
|
||||
sed "s|\(%.*\)|${extra_flags} \1|g" |
|
||||
sed "/^TryExec=.*/d" |
|
||||
@@ -537,7 +537,7 @@ export_service() {
|
||||
temp_file="$(mktemp -u)"
|
||||
mkdir -p "/run/host${host_home}/.config/systemd/user/"
|
||||
|
||||
# Replace all Exec occurrencies
|
||||
# Replace all Exec occurrences
|
||||
cp -f "${service_file}" "${exported_service_fullpath}"
|
||||
chmod 0644 "${exported_service_fullpath}"
|
||||
for exec_cmd in ExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost; do
|
||||
@@ -545,7 +545,7 @@ export_service() {
|
||||
cp -f "${exported_service_fullpath}" "${temp_file}"
|
||||
# Add prefix only if not present
|
||||
if ! grep "${exec_cmd}" "${temp_file}" | grep -q "${container_command_prefix}"; then
|
||||
# Add commmand_prefix
|
||||
# Add command_prefix
|
||||
# Add extra flags
|
||||
# Add closing quote
|
||||
sed "s|^${exec_cmd}=|${exec_cmd}=${container_command_prefix}|g" "${temp_file}" |
|
||||
|
||||
@@ -225,7 +225,7 @@ entry_name="$(echo "${container_name}" | cut -c1 | tr "[:lower:]" "[:upper:]")$(
|
||||
if [ "${icon}" = "auto" ]; then
|
||||
# Set icon to the generic terminal as a fallback.
|
||||
icon="${icon_default}"
|
||||
# This is a NON comprehensive list of logos of the most popular distirbutions. If you find logos for
|
||||
# This is a NON comprehensive list of logos of the most popular distributions. If you find logos for
|
||||
# other supported distros, add it here.
|
||||
DISTRO_ICON_MAP="
|
||||
alma:https://upload.wikimedia.org/wikipedia/commons/e/ec/AlmaLinux_Icon_Logo.png
|
||||
|
||||
@@ -247,7 +247,7 @@ mount_bind() (
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add mountflags if needed, if no are specificed, use rslave as default.
|
||||
# Add mountflags if needed, if no are specified, use rslave as default.
|
||||
if [ "${mount_flags}" = "" ]; then
|
||||
mount_flags="rslave"
|
||||
fi
|
||||
@@ -901,7 +901,7 @@ host_sockets="$(find /run/host/run -name 'user' \
|
||||
# system dbus or user auth cache misused.
|
||||
for host_socket in ${host_sockets}; do
|
||||
container_socket="$(printf "%s" "${host_socket}" | sed 's|/run/host||g')"
|
||||
# Check if the socket already exists or the symlink already esists
|
||||
# Check if the socket already exists or the symlink already exists
|
||||
if [ ! -S "${container_socket}" ] && [ ! -L "${container_socket}" ]; then
|
||||
# link it.
|
||||
rm -f "${container_socket}"
|
||||
|
||||
@@ -65,7 +65,7 @@ done
|
||||
# as it's meaningless for this use case.
|
||||
if [ "$(id -ru)" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
@@ -184,7 +184,7 @@ if [ "${rootful}" -ne 0 ]; then
|
||||
container_manager="${distrobox_sudo_program-} ${container_manager}"
|
||||
fi
|
||||
|
||||
# List containers using custom format that inclused MOUNTS
|
||||
# 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 podman or docker container and a distrobox one.
|
||||
container_list=$(${container_manager} ps -a --no-trunc --format \
|
||||
|
||||
@@ -70,7 +70,7 @@ done
|
||||
# as it's meaningless for this use case.
|
||||
if [ "$(id -ru)" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
|
||||
@@ -68,7 +68,7 @@ done
|
||||
# as it's meaningless for this use case.
|
||||
if [ "$(id -ru)" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
|
||||
@@ -58,7 +58,7 @@ done
|
||||
# as it's meaningless for this use case.
|
||||
if [ "$(id -ru)" -ne 0 ]; then
|
||||
# If the DBX_SUDO_PROGRAM/distrobox_sudo_program variable was set by the
|
||||
# user, use its value instead of "sudo". But only if not runnig the script
|
||||
# user, use its value instead of "sudo". But only if not running the script
|
||||
# as root (UID 0).
|
||||
distrobox_sudo_program=${DBX_SUDO_PROGRAM:-${distrobox_sudo_program:-"sudo"}}
|
||||
fi
|
||||
|
||||
@@ -171,7 +171,7 @@ Fedora Silverblue for the [uBlue](https://github.com/ublue-os) project
|
||||
- Leverage high abundance of curated distro images for docker/podman to
|
||||
manage multiple environments
|
||||
|
||||
Refer to the compatiblity list for an overview of supported host's distro
|
||||
Refer to the compatibility list for an overview of supported host's distro
|
||||
[HERE](compatibility.md#host-distros) and container's distro [HERE](compatibility.md#containers-distros).
|
||||
|
||||
### Aims
|
||||
|
||||
@@ -6,7 +6,7 @@ Installing distrobox on SteamOS is quite straightforward:
|
||||
|
||||
1. Install `distrobox` in your HOME following the `curl` instructions:
|
||||
- [INSTALL](../README.md#curl)
|
||||
2. Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/bin`.
|
||||
2. Add the Path you've chosen to install to your PATH (by default it's `$HOME/.local/bin`.
|
||||
- [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
|
||||
|
||||
## Step 2
|
||||
@@ -16,7 +16,7 @@ The easiest way is to use the script to install it in HOME, so it will survive f
|
||||
|
||||
1. Install `podman` in your HOME following the `curl` command:
|
||||
- [INSTALL](../compatibility.md#install-podman-in-a-static-manner)
|
||||
2. Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/podman/bin`.
|
||||
2. Add the Path you've chosen to install to your PATH (by default it's `$HOME/.local/podman/bin`.
|
||||
- [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
|
||||
|
||||
## Step 3
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
---
|
||||
|
||||
⚠️ **BE CAREFUL**:⚠️ THIS IS EXPERIMENTAL, JUST FOOD FOR TOUGHTS
|
||||
⚠️ **BE CAREFUL**:⚠️ THIS IS EXPERIMENTAL, JUST FOOD FOR THOUGHTS
|
||||
|
||||
# Using a stable-release distribution
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ We will use in this example AlmaLinux 8:
|
||||
:~> distrobox enter --root libvirtd-container
|
||||
```
|
||||
|
||||
Let it initalize, then we can install all the packages we need:
|
||||
Let it initialize, then we can install all the packages we need:
|
||||
|
||||
```console
|
||||
:~> distrobox enter --root libvirtd-container
|
||||
|
||||
@@ -213,7 +213,7 @@ By default distrobox will integrate with host's flatpak directory if present:
|
||||
`/var/lib/flatpak` and obviously with the $HOME one.
|
||||
|
||||
If you want to have a separate system remote between host and container,
|
||||
you can create your distrobox with the followint init-hook:
|
||||
you can create your distrobox with the following init-hook:
|
||||
|
||||
```sh
|
||||
distrobox create --name test --image your-chosen-image:tag \
|
||||
@@ -221,7 +221,7 @@ distrobox create --name test --image your-chosen-image:tag \
|
||||
```
|
||||
|
||||
After that you'll be able to have separate flatpaks between host and distrobox.
|
||||
You can procede to export them using `distrobox-export` (for distrobox 1.2.14+)
|
||||
You can proceed to export them using `distrobox-export` (for distrobox 1.2.14+)
|
||||
|
||||
## Using podman or docker inside a distrobox
|
||||
|
||||
@@ -239,7 +239,7 @@ sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/docker
|
||||
```
|
||||
|
||||
This will create a `podman` or `docker` command inside the distrobox that will
|
||||
trasparently execute the command on the host.
|
||||
transparently execute the command on the host.
|
||||
|
||||
## Using init system inside a distrobox
|
||||
|
||||
@@ -421,7 +421,7 @@ these flags only work during container creation (`podman create` / `podman run`)
|
||||
(`podman exec`, which is used by Distrobox to execute commands inside of container), which means changing resource
|
||||
limitation requires recreation of a container.
|
||||
|
||||
Nontheless you can still apply resource limitation using systemd's resource control functionality. It's not recommended
|
||||
Nonetheless you can still apply resource limitation using systemd's resource control functionality. It's not recommended
|
||||
to pass resource limitation arguments (e.g. `--cpuset-cpus` and `--memory`) to `distrobox create --additional-flags`
|
||||
as systemd already provides much more flexible resource control functionality.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Options:
|
||||
EOF
|
||||
}
|
||||
|
||||
# First thing first, chekc if we have all the dependencies.
|
||||
# First thing first, check if we have all the dependencies.
|
||||
printf >&2 "\033[1;31m Checking dependencies...\n\033[0m"
|
||||
if [ ! -e /etc/subuid ] || [ ! -e /etc/subgid ]; then
|
||||
if ! command -v newuidmap > /dev/null; then
|
||||
@@ -127,7 +127,7 @@ chmod +x /tmp/crun
|
||||
|
||||
PODMAN_VERSION="4.2.1"
|
||||
printf >&2 "\033[1;31m Fetching podman %s...\n\033[0m" "${PODMAN_VERSION}"
|
||||
# Using static podman bulds semplifies our lifes! Thanks to the wonderful project
|
||||
# Using static podman builds semplifies our lives! Thanks to the wonderful project
|
||||
# https://github.com/mgoltzsche/podman-static
|
||||
# All credits to @mgoltzsche for the builds.
|
||||
# Download and unpack the tar in /tmp
|
||||
|
||||
Reference in New Issue
Block a user