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

Handle docker compose and docker space compose #85

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions docker/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

DOCKER_COMPOSE_BIN="docker-compose"
DOCKER_COMPOSE_FROM_DOCKER="docker compose"

if [ -x "$(command -v $DOCKER_COMPOSE_BIN)" ]; then
DOCKER_COMPOSE=$DOCKER_COMPOSE_BIN
else
DOCKER_COMPOSE=$DOCKER_COMPOSE_FROM_DOCKER
fi
3 changes: 2 additions & 1 deletion docker/down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

ROOT="$(dirname $( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P ))"
$ROOT/docker/env.sh
. $ROOT/docker/base.sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is needed to run with .? (same as source, right?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


docker-compose \
$DOCKER_COMPOSE \
--file $ROOT/docker/docker-compose.yaml \
--project-directory $ROOT \
down --volumes --rmi 'all'
3 changes: 2 additions & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

ROOT="$(dirname $( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P ))"
$ROOT/docker/env.sh
. $ROOT/docker/base.sh

docker-compose \
$DOCKER_COMPOSE \
--file $ROOT/docker/docker-compose.yaml \
--project-directory $ROOT \
run --rm cly $@