When REPO_ONLY=1, the script only sets up the package repository and
exits. There's no reason to warn about Docker being already installed or
sleep for 20 seconds in that case.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This PR makes the Docker daemon start automatically after installation
by default, with a --no-autostart opt-out flag. This addresses issue #124
and aligns with the "opinionated convenience" philosophy of get.docker.com.
Changes:
- Autostart enabled by default (AUTOSTART=1)
- Added --no-autostart flag to opt-out
- Smart systemd detection using /run/systemd/system directory check
- Falls back to traditional service management (service/chkconfig/update-rc.d)
- Uses sh_c pattern for proper dry-run support
- All informational messages output to stderr
The systemd detection checks for /run/systemd/system directory which only
exists when systemd is actually running as PID 1. This prevents failures
in container environments where systemctl is installed but systemd is not
running.
Tested across all supported distributions:
- Ubuntu (20.04, 22.04, 24.04)
- Debian (11, 12)
- CentOS Stream (8, 9)
- Fedora (40, 41)
- RHEL/AlmaLinux (8, 9)
Fixes#124
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Gajesh Bhat <gajeshbht@gmail.com>
When building the final install.sh script - fill the latest versions
based on Github releases.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Running in subshell doesn't automatically propagate its exit code to the
parent shell (even with `set -e`).
This made the `make test` command NOT exit with a non-zero exit code if
the test actually failed.
Also drop `tail` call because it's actually better to have the full
trace.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The `--setup-repo` flag allows users to add Docker package repositories
to without automatically installing Docker packages.
This is useful for scenarios where users want to configure the
repository but handle package installation separately.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
On ubuntu bionic and focal (and debian buster too), the docker-model-plugin
package is missing. The suggestion was to just install the package named
docker-buildx-plugin in the version 23 check, while moving the missing
package docker-model-plugin to a new version 28.2 check. The number was
chosen because that package becomes available starting with version 28.2
on ubuntu jammy (while not available in version 28.1 on ubuntu focal).
See: https://github.com/docker/docker-install/issues/509
Signed-off-by: Rejean Groleau <rejeangroleau@gmail.com>