From a92f5522cd94fc5f11fda58e09be482b58b18b23 Mon Sep 17 00:00:00 2001 From: coolgw Date: Sat, 12 Aug 2023 05:56:49 -0400 Subject: [PATCH] Improve bin/attach 1) The socker name using "-" instead of "_" now, for example: kitsu-tools-web-1 2) Some docker has no bash, so we can use sh instead ./bin/attach web OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown --- bin/attach | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/attach b/bin/attach index 338cf1530..c8a6e31ef 100755 --- a/bin/attach +++ b/bin/attach @@ -10,4 +10,4 @@ IFS='/' read -ra ADDR <<< "$BINDIR" POS=$((${#ADDR[@]} - 2)) DIR=${ADDR[$POS]} -docker exec -it "${DIR}_$1_1" /bin/bash +docker exec -it "${DIR}-$1-1" /bin/bash || docker exec -it "${DIR}-$1-1" /bin/sh