diff options
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index c1bade4ba..8885ae7c7 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -2,6 +2,8 @@ package tunnel import ( "context" + "io" + "os" "github.com/containers/image/v5/docker/reference" @@ -210,3 +212,17 @@ func (ic *ContainerEngine) ContainerCommit(ctx context.Context, nameOrId string, } return &entities.CommitReport{Id: response.ID}, nil } + +func (ic *ContainerEngine) ContainerExport(ctx context.Context, nameOrId string, options entities.ContainerExportOptions) error { + var ( + err error + w io.Writer + ) + if len(options.Output) > 0 { + w, err = os.Create(options.Output) + if err != nil { + return err + } + } + return containers.Export(ic.ClientCxt, nameOrId, w) +} |