Skip to content

Commit

Permalink
cvm: A better way to remove orphans
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Dec 26, 2024
1 parent e907dc6 commit d45dea1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion basefiles/app-compose.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=App Compose Service
Requires=docker.service
Wants=docker.service
After=docker.service tboot.service

[Service]
Expand Down
5 changes: 5 additions & 0 deletions basefiles/app-compose.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
tdxctl notify-host -e "boot.progress" -d "starting containers" || true

docker compose up --remove-orphans -d 2>/dev/null || true
chmod +x /usr/bin/containerd-shim-runc-v2
systemctl restart docker

if ! docker compose up --remove-orphans -d; then
tdxctl notify-host -e "boot.error" -d "failed to start containers"
exit 1
Expand Down
4 changes: 4 additions & 0 deletions basefiles/tboot.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#!/bin/sh
# Temporarily disable container auto-start
# This will be re-enabled later by app-compose.sh
chmod -x /usr/bin/containerd-shim-runc-v2

tdxctl tboot

0 comments on commit d45dea1

Please sign in to comment.