Do a perfect match on the container name
This way we avoid to match every container that begins with the same name.
This commit is contained in:
1 parent
da91841ac6
commit
ad4a945941
2 files changed
+2
-2
No files matched your search
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core named containers plugin"
|
||||
version = "0.4.0"
|
||||
version = "0.4.0.1"
|
||||
[plugin.config]
|
||||
@@ -6,7 +6,7 @@ APP="$1"; APP_ROOT="$DOKKU_ROOT/$APP"
|
||||
for container in "$APP_ROOT"/CONTAINER.*; do
|
||||
DYNO=$(echo "$container" | sed -r 's/.*CONTAINER\.(.*)/\1/') || true
|
||||
NAME="$APP.$DYNO"
|
||||
PREVIOUS=$(docker ps -a -q -f name="$NAME") || true
|
||||
PREVIOUS=$(docker ps -a -q -f name="$NAME\$") || true
|
||||
if [[ -n $PREVIOUS ]]; then
|
||||
docker rename "$NAME" "$NAME.$(date +%s)" > /dev/null
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user