fix: deploy step stops containers before recreating to avoid ContainerConfig bug
Build & Release / Docker / backend (push) Successful in 1m6s
Build & Release / Docker / frontend (push) Successful in 1m21s
Build & Release / Desktop / Linux & Windows (push) Successful in 18m49s
Build & Release / Deploy to server (push) Has been skipped
Build & Release / Create release (push) Failing after 29s
Build & Release / Docker / backend (push) Successful in 1m6s
Build & Release / Docker / frontend (push) Successful in 1m21s
Build & Release / Desktop / Linux & Windows (push) Successful in 18m49s
Build & Release / Deploy to server (push) Has been skipped
Build & Release / Create release (push) Failing after 29s
docker-compose 1.29.x fails with KeyError: 'ContainerConfig' when trying to recreate containers built from newer image manifests. Explicitly stopping and removing before 'up -d' avoids the inspection of old container state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
15160b9e86
commit
596e5fffe6
1 file changed
+13
-4
@@ -128,13 +128,22 @@ jobs:
|
||||
script: |
|
||||
cd ${{ secrets.DEPLOY_PATH }}
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.necloud.us -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||
|
||||
# Pull new images first
|
||||
if docker compose version > /dev/null 2>&1; then
|
||||
docker compose pull backend frontend
|
||||
docker compose up -d --no-build backend frontend
|
||||
COMPOSE="docker compose"
|
||||
else
|
||||
docker-compose pull backend frontend
|
||||
docker-compose up -d --no-build backend frontend
|
||||
COMPOSE="docker-compose"
|
||||
fi
|
||||
|
||||
$COMPOSE pull backend frontend
|
||||
|
||||
# Stop and remove old containers so docker-compose up creates fresh ones
|
||||
# (works around ContainerConfig bug in docker-compose 1.29.x)
|
||||
$COMPOSE stop backend frontend || true
|
||||
$COMPOSE rm -f backend frontend || true
|
||||
$COMPOSE up -d backend frontend
|
||||
|
||||
docker logout git.necloud.us
|
||||
docker image prune -f
|
||||
|
||||
|
||||
Reference in new issue
Block a user