Ctrl K
ComunidadGuías…

agent/agentcontainers/containers.go

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
package agentcontainers

import (
	"context"

	"github.com/coder/coder/v2/codersdk"
)

// ContainerCLI is an interface for interacting with containers in a workspace.
type ContainerCLI interface {
	// List returns a list of containers visible to the workspace agent.
	// This should include running and stopped containers.
	List(ctx context.Context) (codersdk.WorkspaceAgentListContainersResponse, error)
	// DetectArchitecture detects the architecture of a container.
	DetectArchitecture(ctx context.Context, containerName string) (string, error)
	// Copy copies a file from the host to a container.
	Copy(ctx context.Context, containerName, src, dst string) error
	// ExecAs executes a command in a container as a specific user.
	ExecAs(ctx context.Context, containerName, user string, args ...string) ([]byte, error)
	// Stop terminates the container
	Stop(ctx context.Context, containerName string) error
	// Remove removes the container
	Remove(ctx context.Context, containerName string) error
}