Skip to content

Commit

Permalink
Prefer docker-compose over podman-compose due to --profile support be…
Browse files Browse the repository at this point in the history
…ing relatively recent in podman
  • Loading branch information
martinothamar committed May 16, 2024
1 parent bec3f3b commit 111e781
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ if ($args[0] -eq "stop")
Write-host "Stopping using docker"
docker compose --profile "*" down -v
}
elseif (Get-Command "docker-compose" -errorAction SilentlyContinue)
{
# If the user is not using docker, there should be podman installed
# If additionally docker-compose is installed, we use that since it has had '--profile' support for a long time,
# whereas podman-compose has only recently added support, and not many users have the latest versions
Write-host "Stopping using docker-compose"
docker-compose --file podman-compose.yml --profile "*" down -v
}
elseif (Get-Command "podman" -errorAction SilentlyContinue)
{
Write-host "Stopping using podman"
Expand All @@ -29,6 +37,15 @@ else
docker compose --profile "*" down -v
docker compose --profile "*" up -d --build
}
elseif (Get-Command "docker-compose" -errorAction SilentlyContinue)
{
# If the user is not using docker, there should be podman installed
# If additionally docker-compose is installed, we use that since it has had '--profile' support for a long time,
# whereas podman-compose has only recently added support, and not many users have the latest versions
Write-host "Running using docker-compose"
docker-compose --file podman-compose.yml --profile "*" down -v
docker-compose --file podman-compose.yml --profile "*" up -d --build
}
elseif (Get-Command "podman" -errorAction SilentlyContinue)
{
Write-host "Running using podman"
Expand Down
13 changes: 13 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ if [ $1 = "stop" ]; then
if [ -x "$(command -v docker)" ]; then
echo "Stopping using docker"
docker compose --profile "*" down -v
elif [ -x "$(command -v docker-compose)" ]; then
# If the user is not using docker, there should be podman installed
# If additionally docker-compose is installed, we use that since it has had '--profile' support for a long time,
# whereas podman-compose has only recently added support, and not many users have the latest versions
echo "Stopping using docker-compose"
docker-compose --file podman-compose.yml --profile "*" down -v
elif [ -x "$(command -v podman)" ]; then
echo "Stopping using podman"
podman compose --file podman-compose.yml --profile "*" down -v
Expand All @@ -20,6 +26,13 @@ else
echo "Running using docker"
docker compose --profile "*" down -v
docker compose --profile "*" up -d --build
elif [ -x "$(command -v docker-compose)" ]; then
# If the user is not using docker, there should be podman installed
# If additionally docker-compose is installed, we use that since it has had '--profile' support for a long time,
# whereas podman-compose has only recently added support, and not many users have the latest versions
echo "Running using docker-compose"
docker-compose --file podman-compose.yml --profile "*" down -v
docker-compose --file podman-compose.yml --profile "*" up -d --build
elif [ -x "$(command -v podman)" ]; then
echo "Running using podman"
podman compose --file podman-compose.yml --profile "*" down -v
Expand Down

0 comments on commit 111e781

Please sign in to comment.