github.com/buildpacks/pack@v0.33.3-0.20240516162812-884dd1837311/pkg/client/docker.go (about)

     1  package client
     2  
     3  import (
     4  	"context"
     5  	"io"
     6  
     7  	"github.com/docker/docker/api/types"
     8  	containertypes "github.com/docker/docker/api/types/container"
     9  	"github.com/docker/docker/api/types/image"
    10  	networktypes "github.com/docker/docker/api/types/network"
    11  	"github.com/docker/docker/api/types/system"
    12  	specs "github.com/opencontainers/image-spec/specs-go/v1"
    13  )
    14  
    15  // DockerClient is the subset of CommonAPIClient which required by this package
    16  type DockerClient interface {
    17  	ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error)
    18  	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
    19  	ImageTag(ctx context.Context, image, ref string) error
    20  	ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error)
    21  	ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
    22  	ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
    23  	ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
    24  	Info(ctx context.Context) (system.Info, error)
    25  	ServerVersion(ctx context.Context) (types.Version, error)
    26  	VolumeRemove(ctx context.Context, volumeID string, force bool) error
    27  	ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, platform *specs.Platform, containerName string) (containertypes.CreateResponse, error)
    28  	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
    29  	ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error)
    30  	ContainerRemove(ctx context.Context, container string, options containertypes.RemoveOptions) error
    31  	CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error
    32  	ContainerWait(ctx context.Context, container string, condition containertypes.WaitCondition) (<-chan containertypes.WaitResponse, <-chan error)
    33  	ContainerAttach(ctx context.Context, container string, options containertypes.AttachOptions) (types.HijackedResponse, error)
    34  	ContainerStart(ctx context.Context, container string, options containertypes.StartOptions) error
    35  }