Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use oci-env's environment variable to define the default container engine #81

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 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
23 changes: 22 additions & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,28 @@ if [ $# -eq 0 ]; then
exit 1
fi

if command -v podman > /dev/null

get_container_engine () {

# allow override from callers such as oci-env
if [[ -z ${COMPOSE_BINARY} ]]; then
jctanner marked this conversation as resolved.
Show resolved Hide resolved
echo "${COMPOSE_BINARY}"
return
jctanner marked this conversation as resolved.
Show resolved Hide resolved
fi

# use podman if found
if command -v podman > /dev/null; then
echo "podman"
return
fi

# default to docker
echo "docker"
}


container_engine=$(get_container_engine)
if [[ "${container_engine}" == "podman" ]]
then
container_exec=podman
ULIMIT_COMMAND=
Expand Down