Bug 1858862

Summary: Podman build from url failed to get correct temp directory for store files
Product: Red Hat Enterprise Linux 8 Reporter: Joy Pu <ypu>
Component: podmanAssignee: Qi Wang <qiwan>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.3CC: bbaude, dwalsh, jligon, jnovy, lsm5, mheon, tsweeney
Target Milestone: rcKeywords: Regression
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-2.0.3-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:06:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joy Pu 2020-07-20 15:46:03 UTC
Description of problem:

podman build will failed when we try to build an image from url. It will try to find Dockfile from a wrong temp directory(record the dir twice). The expect dir is:
/tmp/buildah851125498/docker-firefox-master
But it will try to find the Docker file under:
/tmp/buildah851125498/docker-firefox-master/tmp/buildah851125498/docker-firefox-master

Version-Release number of selected component (if applicable):
podman-2.0.0-0.9.rc7.module+el8.3.0+7084+c16098dd.x86_64

How reproducible:
100%

Steps to Reproduce:
1. podman --log-level debug build github.com/creack/docker-firefox


Actual results:
Command failed with following errors:
Error: error reading info about "/tmp/buildah851125498/docker-firefox-master/tmp/buildah851125498/docker-firefox-master/Dockerfile": stat /tmp/buildah851125498/docker-firefox-master/tmp/buildah851125498/docker-firefox-master/Dockerfile: no such file or directory



Expected results:
Image can be build as expect


Additional info:


From the debug log we can see the files is downloaded to tmp dir normally as expect. But podman will try to find it in a wrong dir. The name of the dir is be record twice in the error message.

DEBU[0000] resolving url "github.com/creack/docker-firefox" to "https://github.com/creack/docker-firefox/archive/master.tar.gz" 
DEBU[0000] extracting "https://github.com/creack/docker-firefox/archive/master.tar.gz" to "/tmp/buildah851125498" 
Error: error reading info about "/tmp/buildah851125498/docker-firefox-master/tmp/buildah851125498/docker-firefox-master/Dockerfile": stat /tmp/buildah851125498/docker-firefox-master/tmp/buildah851125498/docker-firefox-master/Dockerfile: no such file or directory

Comment 1 Tom Sweeney 2020-07-20 18:21:35 UTC
Qi,

can you take a look at this please?

Comment 4 Qi Wang 2020-07-30 20:30:46 UTC
https://github.com/containers/podman/pull/7121  merged to master should fix this.

Comment 6 Daniel Walsh 2020-07-31 13:40:18 UTC
Fixed in podman-2.0.4.

Comment 9 Joy Pu 2020-08-11 14:31:14 UTC
Test with podman-2.0.4-1.module+el8.3.0+7529+55b23fb9.x86_64 and the build can find the Docker file as expect. So set this to verified. Details:

#  podman build github.com/creack/docker-firefox
STEP 1: FROM ubuntu:12.04
STEP 2: run	echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
--> Using cache 5a79b15319ebbf7430a8fae69fb3151392b4ce82ae26b4f43f738a79e554d5e6
STEP 3: run	apt-get update

....

Comment 12 errata-xmlrpc 2020-11-04 03:06:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4694