mirror of
https://github.com/containers/podman.git
synced 2025-08-25 02:22:40 +08:00
Make podman commit to localhost rather then docker.io
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #715 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
e6ec1aaffe
commit
fae5033a01
@ -8,6 +8,7 @@ import (
|
||||
is "github.com/containers/image/storage"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/projectatomic/buildah"
|
||||
"github.com/projectatomic/buildah/util"
|
||||
"github.com/projectatomic/libpod/libpod/image"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -132,13 +133,18 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
|
||||
importBuilder.SetWorkDir(splitChange[1])
|
||||
}
|
||||
}
|
||||
imageRef, err := is.Transport.ParseStoreReference(c.runtime.store, destImage)
|
||||
candidates := util.ResolveName(destImage, "", sc, c.runtime.store)
|
||||
if len(candidates) == 0 {
|
||||
return nil, errors.Errorf("error parsing target image name %q", destImage)
|
||||
}
|
||||
imageRef, err := is.Transport.ParseStoreReference(c.runtime.store, candidates[0])
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error parsing target image name %q", destImage)
|
||||
}
|
||||
id, err := importBuilder.Commit(ctx, imageRef, commitOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = importBuilder.Commit(ctx, imageRef, commitOptions); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Fprintf(commitOptions.ReportWriter, importBuilder.Comment())
|
||||
return c.runtime.imageRuntime.NewFromLocal(imageRef.DockerReference().String())
|
||||
return c.runtime.imageRuntime.NewFromLocal(id)
|
||||
}
|
||||
|
Reference in New Issue
Block a user