mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
enable --iidfile for podman-remote build
for podman-remote build operations, the iidfile, when used, needs to write the file to the client's local filesystem. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -306,7 +306,22 @@ func (ir *ImageEngine) Config(_ context.Context) (*config.Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) {
|
func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) {
|
||||||
return images.Build(ir.ClientCxt, containerFiles, opts)
|
report, err := images.Build(ir.ClientCxt, containerFiles, opts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// For remote clients, if the option for writing to a file was
|
||||||
|
// selected, we need to write to the *client's* filesystem.
|
||||||
|
if len(opts.IIDFile) > 0 {
|
||||||
|
f, err := os.Create(opts.IIDFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if _, err := f.WriteString(report.ID); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return report, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ir *ImageEngine) Tree(ctx context.Context, nameOrID string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {
|
func (ir *ImageEngine) Tree(ctx context.Context, nameOrID string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {
|
||||||
|
@ -179,8 +179,6 @@ var _ = Describe("Podman build", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman build basic alpine and print id to external file", func() {
|
It("podman build basic alpine and print id to external file", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
// Switch to temp dir and restore it afterwards
|
// Switch to temp dir and restore it afterwards
|
||||||
cwd, err := os.Getwd()
|
cwd, err := os.Getwd()
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
|
Reference in New Issue
Block a user