diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-07-28 13:28:39 -0400 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-07-31 13:01:45 +0200 |
commit | 8c6a5286934ebd0144b839223e9dd9a53e4f994a (patch) | |
tree | c253c825d957238a96c4e9bbf2cf41ae5255ffa0 /test | |
parent | 6d7e50891490682b86ab3f4a71cb6e8a7530c8b6 (diff) | |
download | podman-8c6a5286934ebd0144b839223e9dd9a53e4f994a.tar.gz podman-8c6a5286934ebd0144b839223e9dd9a53e4f994a.tar.bz2 podman-8c6a5286934ebd0144b839223e9dd9a53e4f994a.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')
-rw-r--r-- | test/system/070-build.bats | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index fd4ce03fc..7d6660270 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -98,6 +98,26 @@ EOF is "$output" ".*error building at STEP .*: source can't be a URL for COPY" } +@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 |