fix: ensure the tracked container id is up to date
If the ID file contained an incorrect value, calling :start would say the service is started but :info would still show the container as missing. Also fix an issue where docker inspect leaked stderr when the container was missing. Refs dokku/dokku-redis#133
This commit is contained in:
@@ -140,6 +140,10 @@ service_start() {
|
||||
local ID=$(docker ps -aq --no-trunc --filter "status=running" --filter "name=^/$SERVICE_NAME$" --format '{{ .ID }}') || true
|
||||
if [[ -n $ID ]]; then
|
||||
[[ -z $QUIET ]] && dokku_log_warn "Service is already started"
|
||||
if [[ ! -f "$SERVICE_ROOT/ID" ]] || [[ "$(cat "$SERVICE_ROOT/ID")" != "$ID" ]]; then
|
||||
[[ -z $QUIET ]] && dokku_log_warn "Updating local container ID"
|
||||
echo "$ID" >"$SERVICE_ROOT/ID"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user