Skip to content

Commit 4c5b791

Browse files
committed
Allow specification of podman --remote build -f -
Fixes: containers#17495 Signed-off-by: Daniel J Walsh <[email protected]>
1 parent 166f3df commit 4c5b791

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cmd/podman/images/build.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ func build(cmd *cobra.Command, args []string) error {
218218
var containerFiles []string
219219
for _, f := range buildOpts.File {
220220
if f == "-" {
221-
containerFiles = append(containerFiles, "/dev/stdin")
221+
if len(args) == 0 {
222+
args = append(args, "-")
223+
} else {
224+
containerFiles = append(containerFiles, "/dev/stdin")
225+
}
222226
} else {
223227
containerFiles = append(containerFiles, f)
224228
}

test/system/070-build.bats

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ EOF
101101
is "$output" "$rand_content" "reading generated file in image"
102102

103103
run_podman rmi -f build_test
104+
105+
# Now try without specifying a context dir
106+
run_podman build -t build_test -f - < $containerfile
107+
is "$output" ".*COMMIT" "COMMIT seen in log"
108+
109+
run_podman rmi -f build_test
104110
}
105111

106112
@test "podman build - global runtime flags test" {

0 commit comments

Comments
 (0)