Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Fix docker check if docker is a wrapper for podman #1699

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,15 @@ vset () {
fi
}


# Do we need sudo to run docker?
if docker info > /dev/null 2>&1; then
# Is Docker present, and if so, do we need sudo? If docker is a wrapper for
# podman, “docker info” hangs (#1656), so treat that as not found.
if ( ! command -v docker > /dev/null 2>&1 ) \
|| ( docker --help 2>&1 | grep -Fqi podman ); then
docker_ () {
echo 'docker not found; unreachable code reached' 1>&1
exit 1
}
elif docker info > /dev/null 2>&1; then
docker_ () {
docker "$@"
}
Expand Down
Loading