openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
907 stars 436 forks source link

Adding repository in Dockerfile via .repo fails #10830

Open KucharczykL opened 3 years ago

KucharczykL commented 3 years ago

Issue Description

When building a container from Dockerfile, adding zypper reporsitory fails when added directly via .repo file.

This doesn't work with HTTP nor HTTPS:

RUN zypper ar https://download.opensuse.org/repositories/Documentation:/Containers/openSUSE_Leap_15.2/Documentation:Containers.repo

[    7s] Step 7/14 : RUN zypper ar https://download.opensuse.org/repositories/Documentation:/Containers/openSUSE_Leap_15.2/Documentation:Containers.repo
[    7s]  ---> Running in eec73e28889d
[    7s] time="2021-03-04T09:16:07.667877508Z" level=info msg="shim containerd-shim started" address="unix:///run/containerd/s/07e0df958c3161f99da218884c9f8395b79a9fbf9ec45b0b65560336ddeb083b" debug=false pid=28496
[    8s] Download (curl) error for 'https://download.opensuse.org/repositories/Documentation:/Containers/openS
[    8s] Error code: Connection failed
[    8s] Error message: Could not resolve host: download.opensuse.org

This works with both HTTP and HTTPS:

RUN zypper ar http://download.opensuse.org/repositories/Documentation:/Containers/openSUSE_Leap_15.2/ "Documentation:Containers:openSUSE_Leap_15"

Expected Result

Adding a zypper repository by referencing the .repo file does not fail.

How to Reproduce

  1. Add RUN zypper ar https://download.opensuse.org/repositories/Documentation:/Containers/openSUSE_Leap_15.2/Documentation:Containers.repo to your package Dockerfile
  2. Run osc build
  3. See error
SchoolGuy commented 1 year ago

I can second this. Adding a repository in the project is not a solution in this case because then the Dockerfile is unusable outside of the context of OBS.