-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
5 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ if [ "$(id -u)" != "0" ]; then | |
fi | ||
|
||
: "${CONTAINER_ENGINE:=docker}" | ||
: "${CONTAINER_ROOTFUL:=false}" | ||
script_dir="$(dirname "$0")" | ||
|
||
if [ ! -e /etc/systemd/system/[email protected]/delegate.conf ]; then | ||
|
@@ -64,8 +65,12 @@ else | |
apt-get install -y git uidmap make jq | ||
fi | ||
|
||
case "${CONTAINER_ENGINE}" in | ||
"docker") | ||
setup_docker() { | ||
if [ "${CONTAINER_ROOTFUL}" = "true" ]; then | ||
echo "Preparing to run docker in default rootful mode." | ||
return | ||
fi | ||
echo "Preparing to run docker in rootless mode." | ||
if ! command -v dockerd-rootless-setuptool.sh >/dev/null 2>&1; then | ||
if grep -q centos /etc/os-release; then | ||
# Works with Rocky and Alma too | ||
|
@@ -76,9 +81,11 @@ case "${CONTAINER_ENGINE}" in | |
fi | ||
fi | ||
systemctl disable --now docker | ||
;; | ||
"docker-rootful") | ||
echo "Preparing to run docker in default rootful mode." | ||
} | ||
|
||
case "${CONTAINER_ENGINE}" in | ||
"docker") | ||
setup_docker | ||
;; | ||
"podman") | ||
if ! command -v podman-compose >/dev/null 2>&1; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters