upgrade_docker.go 720 B

12345678910111213141516171819202122232425
  1. package cmd
  2. import (
  3. "context"
  4. "github.com/0xJacky/Nginx-UI/internal/docker"
  5. "github.com/gin-gonic/gin"
  6. "github.com/uozi-tech/cosy/logger"
  7. "github.com/urfave/cli/v3"
  8. )
  9. // Command to be executed in the temporary container
  10. var UpgradeDockerStep2Command = &cli.Command{
  11. Name: "upgrade-docker-step2",
  12. Usage: "Execute the second step of Docker container upgrade (to be run inside the temp container)",
  13. Action: UpgradeDockerStep2,
  14. }
  15. // UpgradeDockerStep2 executes the second step in the temporary container
  16. func UpgradeDockerStep2(ctx context.Context, command *cli.Command) error {
  17. logger.Init(gin.DebugMode)
  18. logger.Info("Starting Docker OTA upgrade step 2 from CLI...")
  19. return docker.UpgradeStepTwo(ctx)
  20. }