func (c *ContainerExecutor) Execute(s executor.ServiceExecutionInfo) error {
	c.ServiceExecutionInfo = addRequestEnv(s)
	log.Println(logPrefix, c.ServiceName, c.ParamStr)
	log.Println(logPrefix, "parameter length :", len(c.ParamStr))
	paramLen := len(c.ParamStr)
	err := verifier.GetInstance().ContainerIsInWhiteList(c.ParamStr[paramLen-1])
	if err != nil {
		log.Println(logPrefix, err.Error())
		return err
	}
	err = c.ceImplIns.ImagePull(c.ParamStr[paramLen-1])
	if err != nil {
		log.Println(logPrefix, err.Error())
	}
	resp, err := c.ceImplIns.Create(convertConfig(c.ParamStr))
	if err != nil {
		log.Println(logPrefix, err.Error())
	} else {
		log.Println(logPrefix, "create container :", resp.ID[:10])
	}
	err = c.ceImplIns.Start(resp.ID)
	if err != nil {
		log.Println("err :", err)
		return err
	}
	out, err := c.ceImplIns.Logs(resp.ID)
	if err != nil {
		log.Println(logPrefix, err.Error())
	} else {
		stdcopy.StdCopy(os.Stdout, os.Stderr, out)
	}
	var executionStatus string
	statusCh, errCh := c.ceImplIns.Wait(resp.ID, container.WaitConditionNotRunning)
	select {
	case err = <-errCh:
		log.Println(logPrefix, err.Error())
		executionStatus = servicemgr.ConstServiceStatusFailed
	case status := <-statusCh:
		log.Println(logPrefix, "container execution status :", status.StatusCode)
		if status.StatusCode == 0 {
			executionStatus = servicemgr.ConstServiceStatusFinished
		}
	}
	c.NotiImplIns.InvokeNotification(c.NotificationTargetURL, float64(c.ServiceID), executionStatus)
	err = c.ceImplIns.Remove(resp.ID)
	if err != nil {
		log.Println(logPrefix, err.Error())
	}
	return nil
}
Execute executes container service application
package containerexecutor
import (
	"os"
	"runtime"
	"github.com/lf-edge/edge-home-orchestration-go/internal/common/logmgr"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/api/types/network"
	"github.com/docker/docker/pkg/stdcopy"
	"github.com/spf13/pflag"
	verifier "github.com/lf-edge/edge-home-orchestration-go/internal/controller/securemgr/verifier"
	servicemgr "github.com/lf-edge/edge-home-orchestration-go/internal/controller/servicemgr"
	"github.com/lf-edge/edge-home-orchestration-go/internal/controller/servicemgr/executor"
	"github.com/lf-edge/edge-home-orchestration-go/internal/controller/servicemgr/notification"
)
var (
	logPrefix         = "[containerexecutor]"
	log               = logmgr.GetInstance()
	containerExecutor *ContainerExecutor
)
type ContainerExecutor struct {
	executor.ServiceExecutionInfo
	ceImplIns CEImpl
	executor.HasClientNotification
}
func init() {
	containerExecutor = &ContainerExecutor{}
	containerExecutor.SetCEImpl(newCEDocker())
	containerExecutor.SetNotiImpl(notification.GetInstance())
}
func GetInstance() *ContainerExecutor {
	return containerExecutor
}