Help us shape the future of Go! Take the 2026 Go Developer Survey

containerops

package
v5.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package containerops implements the operations that act from the outside on the container of a service: exec, cp, export and commit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	engine.Backend
	// Events receives the progress of the operations.
	Events() api.EventProcessor
	// DryRun tells whether the operations only report what they would do.
	DryRun() bool
	// CLI is the Docker CLI Compose runs in, and the owner of the terminal streams.
	CLI() command.Cli
}

Backend is what the operations need from the engine they act on.

The terminal reaches them through CLI: stdin, stdout and the TTY all come from the Docker CLI's streams, the one seam through which an operation that talks to the user does so (exec hands the whole CLI to the Docker CLI's own implementation).

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service runs the container operations on a Backend.

func New

func New(backend Backend) *Service

New creates a Service acting on the given Backend.

func (*Service) Commit

func (s *Service) Commit(ctx context.Context, projectName string, options api.CommitOptions) error

Commit creates an image from the changes made to a container of a service.

func (*Service) Copy

func (s *Service) Copy(ctx context.Context, projectName string, options api.CopyOptions) error

Copy copies files between the host and the containers of a service.

func (*Service) Exec

func (s *Service) Exec(ctx context.Context, projectName string, options api.RunOptions) (int, error)

Exec runs a command in a running container of a service and returns its exit code.

func (*Service) Export

func (s *Service) Export(ctx context.Context, projectName string, options api.ExportOptions) error

Export writes the filesystem of a container of a service as a tar archive.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL