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:
Jose Diaz-Gonzalez
2019-06-11 15:44:20 -04:00
parent 99ee8e7113
commit 0ba13eec86
2 changed files with 5 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ docker_ports_options() {
get_container_ip() {
declare desc="Retrieves the ip address of a container"
declare CONTAINER_ID="$1"
docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$CONTAINER_ID"
docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$CONTAINER_ID" 2>/dev/null
}
get_database_name() {