Add SBX env var to install docker-sbx package

Allow users to opt into installing the docker-sbx package alongside
the standard Docker Engine packages by setting SBX=1, for example:

    curl -fsSL https://get.docker.com | sudo SBX=1 sh

This mirrors the existing pattern used by other env vars (CHANNEL,
VERSION, etc.) and adds the docker-sbx package to the apt and
dnf/yum install package lists when SBX is set to "1".

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
This commit is contained in:
Eric Curtin committed 2026-08-11 13:56:20 +01:00
1 parent 263edc94d3
commit a02aa0bdb5
1 file changed
+14
+14
View File
@@ -94,6 +94,13 @@ set -e
#
# Note: Starting the service requires appropriate privileges to manage system services.
#
# Installing docker-sbx
#
# Set the SBX environment variable to "1" to also install the docker-sbx
# package alongside the regular Docker Engine packages:
#
# $ curl -fsSL https://get.docker.com | sudo SBX=1 sh
#
# ==============================================================================
@@ -131,6 +138,7 @@ mirror=''
DRY_RUN=${DRY_RUN:-}
REPO_ONLY=${REPO_ONLY:-0}
NO_AUTOSTART=${NO_AUTOSTART:-0}
SBX=${SBX:-0}
while [ $# -gt 0 ]; do
case "$1" in
--channel)
@@ -631,6 +639,9 @@ do_install() {
if version_gte "28.2"; then
pkgs="$pkgs docker-model-plugin"
fi
if [ "$SBX" = "1" ]; then
pkgs="$pkgs docker-sbx"
fi
if ! is_dry_run; then
set -x
fi
@@ -743,6 +754,9 @@ do_install() {
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
fi
if [ "$SBX" = "1" ]; then
pkgs="$pkgs docker-sbx"
fi
if ! is_dry_run; then
set -x
fi