all: use new default name for distrobox containers to avoid conflicts with toolbx

Right now, default name for a toolbox is `fedora-toolbox-XX`, which
corresponds to the same pattern also distrobox uses for its default.

Change the default behavior to use `my-distrobox` in case no name and no
image are specified, in order to not have clashes with the other
project.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
Luca Di Maio
2022-05-25 19:38:16 +02:00
parent ffc24a63a4
commit 7461d9db4e
6 changed files with 18 additions and 10 deletions
+10 -2
View File
@@ -109,7 +109,7 @@ Usage:
distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
distrobox create --clone fedora-toolbox-35 --name fedora-toolbox-35-copy
distrobox create --clone fedora-35 --name fedora-35-copy
distrobox create --image alpine my-alpine-container
distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
distrobox create --pull --image centos:stream9 --home ~/distrobox/centos9
@@ -119,7 +119,7 @@ Usage:
Options:
--image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:35
--name/-n: name for the distrobox default: fedora-toolbox-35
--name/-n: name for the distrobox default: my-distrobox
--pull/-p: pull the image even if it exists locally (implies --yes)
--yes/-Y: non-interactive, pull images without asking
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
@@ -280,6 +280,14 @@ if [ -z "${container_clone}" ] && [ -z "${container_image}" ]; then
container_image="${container_image_default}"
fi
# If no name is specified and we're using the default container_image, then let's
# set a default name for the container, that is distinguishable from the default
# toolbx one. This will avoid problems when using both toolbx and distrobox on
# the same system.
if [ -z "${container_name}" ] && [ "${container_image}" = "${container_image_default}" ]; then
container_name="my-distrobox"
fi
# If no container_name is declared, we build our container name starting from the
# container image specified.
#
+3 -3
View File
@@ -45,7 +45,7 @@ container_shell="${SHELL:-"bash"}"
# exotic paths.
container_shell="$(basename "${container_shell}") -l"
container_manager="autodetect"
container_name="fedora-toolbox-35"
container_name="my-distrobox"
container_manager_additional_flags=""
# Use cd + dirname + pwd so that we do not have relative paths in mount points
@@ -86,7 +86,7 @@ distrobox version: ${version}
Usage:
distrobox-enter --name fedora-toolbox-35 -- bash -l
distrobox-enter --name fedora-35 -- bash -l
distrobox-enter my-alpine-container -- sh -l
distrobox-enter --additional-flags "--preserve-fds" --name test -- bash -l
distrobox-enter --additional-flags "--env MY_VAR=value" --name test -- bash -l
@@ -94,7 +94,7 @@ Usage:
Options:
--name/-n: name for the distrobox default: fedora-toolbox-35
--name/-n: name for the distrobox default: my-distrobox
--/-e: end arguments execute the rest as command to execute at login default: bash -l
--no-tty/-T: do not instantiate a tty
--additional-flags/-a: additional flags to pass to the container manager command
+1 -1
View File
@@ -34,7 +34,7 @@ fi
# Defaults
container_manager="autodetect"
container_name="fedora-toolbox-35"
container_name="my-distrobox"
force=0
non_interactive=0
rootful=0
+1 -1
View File
@@ -34,7 +34,7 @@ fi
# Defaults
container_manager="autodetect"
container_name="fedora-toolbox-35"
container_name="my-distrobox"
non_interactive=0
rootful=0
verbose=0
+2 -2
View File
@@ -12,7 +12,7 @@ Usage:
distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
distrobox create --clone fedora-toolbox-35 --name fedora-toolbox-35-copy
distrobox create --clone fedora-35 --name fedora-35-copy
distrobox create --image alpine my-alpine-container
distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
distrobox create --pull --image centos:stream9 --home ~/distrobox/centos9
@@ -33,7 +33,7 @@ Supported environment variables:
Options:
--image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:35
--name/-n: name for the distrobox default: fedora-toolbox-35
--name/-n: name for the distrobox default: my-distrobox
--pull/-p: pull latest image unconditionally without asking
--yes/-Y: non-interactive, pull images without asking
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+1 -1
View File
@@ -26,7 +26,7 @@ Supported environment variables:
Options:
--name/-n: name for the distrobox default: fedora-toolbox-35
--name/-n: name for the distrobox default: my-distrobox
--/-e: end arguments execute the rest as command to execute at login default: bash -l
--no-tty/-T: do not instantiate a tty
--additional-flags/-a: additional flags to pass to the container manager command