From e6810fa7e0476053f33222bc4c679423c606e250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=84nis=20Vi=CC=84tols?= Date: Tue, 28 Aug 2018 10:29:12 +0300 Subject: [PATCH 1/2] Fix `No such container: Binary` problem Ignore `docker ps` truncation. Looks like in new Docker version (in my case Docker version 18.06.0-ce, build 0ffa825) long commands are truncated and sometimes can return/contain binary output (truncation `...` symbols are binary). Because of such output `grep -e` fails to find container. Workaround was to use `--no-trunc` for `docker ps` command. --- functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions b/functions index da9ddcf..1a2e9ec 100755 --- a/functions +++ b/functions @@ -81,7 +81,7 @@ service_create_container() { service_stop "$SERVICE" > /dev/null docker run --rm -i -v "$SERVICE_HOST_ROOT/data:/var/lib/postgresql/data" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -s < "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/enable_ssl.sh" &> /dev/null - PREVIOUS_ID=$(docker ps -f status=exited | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true + PREVIOUS_ID=$(docker ps -f status=exited --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true docker start "$PREVIOUS_ID" > /dev/null service_port_unpause "$SERVICE" @@ -122,14 +122,14 @@ service_start() { local QUIET="$2" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local SERVICE_NAME="$(get_service_name "$SERVICE")" - local ID=$(docker ps -f status=running | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true + local ID=$(docker ps -f status=running --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true if [[ -n $ID ]]; then [[ -z $QUIET ]] && dokku_log_warn "Service is already started" return 0 fi dokku_log_info2_quiet "Starting container" - local PREVIOUS_ID=$(docker ps -f status=exited | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true + local PREVIOUS_ID=$(docker ps -f status=exited --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true local IMAGE_EXISTS=$(docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " && true) local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")" From 26a1948e50937a24ffc84ef3927b8d0eb46bc1c4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 2 Dec 2018 05:13:34 -0500 Subject: [PATCH 2/2] Update functions --- functions | 1 - 1 file changed, 1 deletion(-) diff --git a/functions b/functions index c7e3289..4abc96f 100755 --- a/functions +++ b/functions @@ -130,7 +130,6 @@ service_start() { dokku_log_info2_quiet "Starting container" local PREVIOUS_ID=$(docker ps -f status=exited --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true - local IMAGE_EXISTS=$(docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " && true) local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")" if [[ -n $PREVIOUS_ID ]]; then