Open fikrapdso opened 9 months ago
@fikrapdso, if I understand the problem correctly, you have a container that crashes after starting, so you are not able to deploy new image version using docker rollout
. Is that correct?
I think in this case docker rollout should recreate the container if it's not running instead of starting it, so it behaves the same as docker compose up
.
Can you let me know if removing --no-recreate
flag in line 89 solves the problem?
diff --git a/docker-rollout b/docker-rollout
index 5da1986..6040ab9 100755
--- a/docker-rollout
+++ b/docker-rollout
@@ -86,7 +86,7 @@ main() {
# shellcheck disable=SC2086 # COMPOSE_FILES and ENV_FILES must be unquoted to allow multiple files
if [[ "$($COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES ps --quiet "$SERVICE")" == "" ]]; then
echo "==> Service '$SERVICE' is not running. Starting the service."
- $COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --detach --no-recreate "$SERVICE"
+ $COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --detach "$SERVICE"
exit 0
fi
When the old instance has status
Exited
, rollout command not start the new instance. it trying to start the old instance instead and break because the old instance has error in it.I expected it to ignore the error in old instance and start the new instance. Then re route the when the new instance is ready.
after that line, no
scaling
happens for that service