diff options
author | baude <bbaude@redhat.com> | 2020-09-17 12:55:48 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-09-17 12:55:48 -0500 |
commit | ec58650939e8dacb3b53740699bcd6df4746cc51 (patch) | |
tree | 4d8dc053f3733d8b4952b42ede251dc1c5707f14 /pkg | |
parent | 031ddf9c8476202c6b0c810c6c0f6a7a0040c035 (diff) | |
download | podman-ec58650939e8dacb3b53740699bcd6df4746cc51.tar.gz podman-ec58650939e8dacb3b53740699bcd6df4746cc51.tar.bz2 podman-ec58650939e8dacb3b53740699bcd6df4746cc51.zip |
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>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 50b8342a3..332a7c2eb 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -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) { - 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) { |