Bug 1690209 - podman build fails to yum install, but docker works fine
Summary: podman build fails to yum install, but docker works fine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: podman
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 02:28 UTC by Eric Paris
Modified: 2019-04-10 07:36 UTC (History)
6 users (show)

Fixed In Version: podman-1.2.0-2.git3bd528e.fc30 podman-1.2.0-2.git3bd528e.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-06 20:18:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eric Paris 2019-03-19 02:28:24 UTC
$ cat Dockerfile 
FROM fedora
RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all

COPY launch.sh /bin/
RUN chmod +x /bin/launch.sh

CMD /bin/launch.sh



$ docker build --no-cache . -t quay.io/eparis/ssh
Sending build context to Docker daemon 4.608 kB
Step 1/5 : FROM fedora
 ---> d09302f77cfc
Step 2/5 : RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all
 ---> Running in 789076fda42f
Fedora Modular 29 - x86_64                      222 kB/s | 1.5 MB     00:06    
Fedora Modular 29 - x86_64 - Updates            414 kB/s | 2.1 MB     00:05    
Fedora 29 - x86_64 - Updates                    1.2 MB/s |  24 MB     00:20    
Fedora 29 - x86_64                              4.5 MB/s |  62 MB     00:13    
Last metadata expiration check: 0:00:01 ago on Tue Mar 19 02:05:18 2019.
Dependencies resolved.
================================================================================
 Package                     Arch       Version               Repository   Size
================================================================================
Upgrading:
 libcap-ng                   x86_64     0.7.9-5.fc29          updates      26 k
 libxcrypt                   x86_64     4.4.4-1.fc29          updates     119 k
 
[snip lots of success]

Complete!
33 files removed
 ---> 688395a2f3d0
Removing intermediate container 789076fda42f
Step 3/5 : COPY launch.sh /bin/
 ---> d7a8e885f634
Removing intermediate container ff222778884c
Step 4/5 : RUN chmod +x /bin/launch.sh
 ---> Running in fbb04c02c0b3
 ---> fa8dd50b9d5e
Removing intermediate container fbb04c02c0b3
Step 5/5 : CMD /bin/launch.sh
 ---> Running in 8d5d68e10301
 ---> 6e453814bbfe
Removing intermediate container 8d5d68e10301
Successfully built 6e453814bbfe



$ podman build --no-cache . -t quay.io/eparis/ssh
STEP 1: FROM fedora
STEP 2: RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all
Fedora Modular 29 - x86_64                      0.0  B/s |   0  B     00:00    
Failed to synchronize cache for repo 'fedora-modular'
Error: Failed to synchronize cache for repo 'fedora-modular'
Error: error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DISTTAG=fcontainer FGC=f FBR=f] Command:run Args:[yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all] Flags:[] Attrs:map[] Message:RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all Original:RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all}: error while running runtime: exit status 1



$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-65.git1185cfd.fc30.x86_64
 Go version:      go1.12beta2
 Git commit:      1185cfd/1.13.1
 Built:           Tue Feb 12 16:56:28 2019
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-65.git1185cfd.fc30.x86_64
 Go version:      go1.12beta2
 Git commit:      1185cfd/1.13.1
 Built:           Tue Feb 12 16:56:28 2019
 OS/Arch:         linux/amd64
 Experimental:    false


$ podman version
Version:            1.1.2
RemoteAPI Version:  1
Go Version:         go1.12
OS/Arch:            linux/amd64

Comment 1 Daniel Walsh 2019-03-19 12:48:34 UTC
This worked fine for me.  I think you had a hiccup in the network that caused yum inside of the container to fail. Could you try the podman command again.

Comment 2 Eric Paris 2019-03-19 15:32:55 UTC
$ podman build --no-cache -t quay.io/eparis/ssh .
STEP 1: FROM fedora
STEP 2: RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all
Fedora Modular 29 - x86_64                      0.0  B/s |   0  B     00:01    
Failed to synchronize cache for repo 'fedora-modular'
Error: Failed to synchronize cache for repo 'fedora-modular'
Error: error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DISTTAG=fcontainer FGC=f FBR=f] Command:run Args:[yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all] Flags:[] Attrs:map[] Message:RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all Original:RUN yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all}: error while running runtime: exit status 1


$ rpm -q podman
podman-1.1.2-2.dev.git0ad9b6b.fc30.x86_64

Comment 3 Daniel Walsh 2019-03-19 15:38:12 UTC
Weird.  Do regular containers work for  you?

Comment 4 Daniel Walsh 2019-03-19 15:38:33 UTC
Giuseppe any idea?

Comment 5 Eric Paris 2019-03-19 15:42:53 UTC
$ podman run --rm -ti docker.io/library/fedora /bin/bash

[root@490d2bd80a16 /]# cat /etc/os-release 
NAME=Fedora
VERSION="29 (Container Image)"
ID=fedora
VERSION_ID=29
VERSION_CODENAME=""
PLATFORM_ID="platform:f29"
PRETTY_NAME="Fedora 29 (Container Image)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:29"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f29/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=29
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=29
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Container Image"
VARIANT_ID=container

Comment 6 Eric Paris 2019-03-19 15:45:14 UTC
running yum in a fedora container seems to work...

$ podman run --rm -ti docker.io/library/fedora /bin/bash
[root@2070d206c7f5 /]# yum update -y && yum install -y openssh-server openssh-clients jq origin-clients && yum clean all
Fedora Modular 29 - x86_64                                                                                                                                                                                    291 kB/s | 1.5 MB     00:05    
Fedora Modular 29 - x86_64 - Updates                                                                                                                                                                          455 kB/s | 2.1 MB     00:04    
Fedora 29 - x86_64 - Updates                                                                                                                                                                                  869 kB/s |  24 MB     00:28    
Fedora 29 - x86_64                                                                                   2% [==-                                                                                                ] 1.0 MB/s | 1.8 MB     01:00 ETA

Comment 7 Giuseppe Scrivano 2019-03-19 16:03:54 UTC
how does your /etc/resolv.conf look like on the host?

I think it is the issue with rootless Buildah where we bind mount /etc/resolv.conf and we cannot reach 127.0.0.1 on the host, we have a workaround for using --net host, that got merged few days ago:

https://github.com/containers/libpod/pull/2585
https://github.com/containers/buildah/pull/1395

Comment 8 Eric Paris 2019-03-19 16:05:14 UTC
$ cat /etc/resolv.conf 
# Generated by NetworkManager
search redhat.com
nameserver 127.0.0.1

Comment 9 Giuseppe Scrivano 2019-03-19 16:13:18 UTC
that confirms the issue: when we bind mount /etc/resolv.conf in the container we are not able to reach 127.0.0.1 from the container

Comment 10 Giuseppe Scrivano 2019-03-19 16:48:45 UTC
Dan, Buildah uses by default --net host when running as root user.  Should we do the same for rootless or expect an explicit --net host?

The difference with podman is that we don't have the pkg/resolvconf logic for cleaning up the resolv.conf file

Comment 11 Daniel Walsh 2019-03-19 17:03:11 UTC
Yes buildah as root should run the same as non-root.

Comment 12 Giuseppe Scrivano 2019-03-19 20:11:53 UTC
opened a pr here: https://github.com/containers/buildah/pull/1421

Comment 13 Fedora Update System 2019-04-01 14:47:42 UTC
podman-1.2.0-2.git3bd528e.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-8875ae3cff

Comment 14 Fedora Update System 2019-04-01 14:47:55 UTC
podman-1.2.0-2.git3bd528e.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-dede809f2a

Comment 15 Fedora Update System 2019-04-02 02:07:12 UTC
podman-1.2.0-2.git3bd528e.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-8875ae3cff

Comment 16 Fedora Update System 2019-04-02 02:29:58 UTC
podman-1.2.0-2.git3bd528e.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-dede809f2a

Comment 17 Fedora Update System 2019-04-06 20:18:55 UTC
podman-1.2.0-2.git3bd528e.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2019-04-10 07:36:23 UTC
podman-1.2.0-2.git3bd528e.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.