diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-07-28 13:28:39 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-07-28 14:51:21 -0400 |
commit | a35045cbc4a6c22ab95bd203b134ce0e30f344e2 (patch) | |
tree | be9468c6514a9c6379c35462cdc4c7812459f8a2 /test/system/070-build.bats | |
parent | 288ebec6e737c105fa0ef43412de4e0a8997feb9 (diff) | |
download | podman-a35045cbc4a6c22ab95bd203b134ce0e30f344e2.tar.gz podman-a35045cbc4a6c22ab95bd203b134ce0e30f344e2.tar.bz2 podman-a35045cbc4a6c22ab95bd203b134ce0e30f344e2.zip |
Fix building from http or '-' options
When copying from a URL, podman will download and create a context
directory in a temporary file. The problem was that this directory
was being removed as soon as the function that created it was returned.
Later the build code would look for content in the temporary directory
and fail to find it, blowing up the build.
By pulling the extraction code back into the build function, we keep the
temporary directory around until the build completes.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system/070-build.bats')
-rw-r--r-- | test/system/070-build.bats | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 84d3adec1..33585da0d 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -177,6 +177,27 @@ Labels.$label_name | $label_value run_podman rmi -f build_test } +@test "podman build - stdin test" { + if is_remote && is_rootless; then + skip "unreliable with podman-remote and rootless; #2972" + fi + + # Random workdir, and multiple random strings to verify command & env + workdir=/$(random_string 10) + PODMAN_TIMEOUT=240 run_podman build -t build_test - << EOF +FROM $IMAGE +RUN mkdir $workdir +WORKDIR $workdir +RUN /bin/echo 'Test' +EOF + is "$output" ".*STEP 5: COMMIT" "COMMIT seen in log" + + run_podman run --rm build_test pwd + is "$output" "$workdir" "pwd command in container" + + run_podman rmi -f build_test +} + function teardown() { # A timeout or other error in 'build' can leave behind stale images # that podman can't even see and which will cascade into subsequent |