dk: s'assurer que docker-compose et docker existent quand on crée le service

This commit is contained in:
Jephté Clain 2018-12-07 16:04:18 +04:00
parent d70825c296
commit 44b1954a43
1 changed files with 14 additions and 0 deletions

14
dk
View File

@ -267,6 +267,13 @@ function auto_up() {
function default_compose_service() { function default_compose_service() {
local docker_compose="$(which docker-compose)" local docker_compose="$(which docker-compose)"
if [ -z "$docker_compose" -a -x /usr/bin/docker-compose ]; then
docker_compose=/usr/bin/docker-compose
elif [ -z "$docker_compose" -a -x /usr/local/bin/docker-compose ]; then
docker_compose=/usr/local/bin/docker-compose
else
die "Impossible de trouver docker-compose"
fi
setx startcmd=qvals "$docker_compose" \ setx startcmd=qvals "$docker_compose" \
"${replace_env_args[@]}" "${env_args[@]}" \ "${replace_env_args[@]}" "${env_args[@]}" \
up "${replace_run_args[@]}" "${run_args[@]}" \ up "${replace_run_args[@]}" "${run_args[@]}" \
@ -275,6 +282,13 @@ function default_compose_service() {
} }
function default_docker_service() { function default_docker_service() {
local docker="$(which docker)" local docker="$(which docker)"
if [ -z "$docker" -a -x /usr/bin/docker ]; then
docker=/usr/bin/docker
elif [ -z "$docker" -a -x /usr/local/bin/docker ]; then
docker=/usr/local/bin/docker
else
die "Impossible de trouver docker"
fi
setx startcmd=qvals "$docker" run \ setx startcmd=qvals "$docker" run \
"${replace_env_args[@]}" "${env_args[@]}" \ "${replace_env_args[@]}" "${env_args[@]}" \
"${replace_run_args[@]}" "${run_args[@]}" \ "${replace_run_args[@]}" "${run_args[@]}" \