SUSE / container-suseconnect

Provides access to repositories inside containers using the host entitlements
Apache License 2.0
19 stars 16 forks source link

Zypper got HTTP 401 on refresh with SLES15SP1 on GCE in docker #41

Closed acmnu closed 3 years ago

acmnu commented 4 years ago

Environment:

Reproduce steps:

ENV ADDITIONAL_MODULES sle-module-desktop-applications,sle-module-development-tools

ADD http://smt-gce.susecloud.net/smt.crt /etc/pki/trust/anchors/smt.crt RUN update-ca-certificates RUN container-suseconnect

RUN zypper --gpg-auto-import-keys ref -s RUN zypper -n in gvim

* Build docker. (Take a note about addition /etc/hosts entry about smt server) 

docker build -t test1 --add-host="smt-gce.susecloud.net:192.158.29.172" .


#### Expected

Docker build success.

#### Actual

docker build -t test1 \

--add-host="smt-gce.susecloud.net:192.158.29.172" \ . Sending build context to Docker daemon 14.85kB Step 1/7 : FROM registry.suse.com/suse/sle15:latest ---> 91f2bad53a20 Step 2/7 : ENV ADDITIONAL_MODULES sle-module-desktop-applications,sle-module-development-tools ---> Using cache ---> 4fd55addbbcb Step 3/7 : ADD http://smt-gce.susecloud.net/smt.crt /etc/pki/trust/anchors/smt.crt Downloading [==================================================>] 1.891kB/1.891kB ---> Using cache ---> 293e850276b3 Step 4/7 : RUN update-ca-certificates ---> Using cache ---> 50c9c64805e1 Step 5/7 : RUN container-suseconnect ---> Using cache ---> 91263b5080c8 Step 6/7 : RUN zypper --gpg-auto-import-keys ref -s ---> Running in 341a38f50f23 Refreshing service 'container-suseconnect-zypp'. Adding repository 'SLE-Module-Basesystem15-SP1-Debuginfo-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Basesystem15-SP1-Debuginfo-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Basesystem15-SP1-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Basesystem15-SP1-Source-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Basesystem15-SP1-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Desktop-Applications15-SP1-Debuginfo-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Desktop-Applications15-SP1-Debuginfo-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Desktop-Applications15-SP1-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Desktop-Applications15-SP1-Source-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Desktop-Applications15-SP1-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-DevTools15-SP1-Debuginfo-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-DevTools15-SP1-Debuginfo-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-DevTools15-SP1-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-DevTools15-SP1-Source-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-DevTools15-SP1-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Server-Applications15-SP1-Debuginfo-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Server-Applications15-SP1-Debuginfo-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Server-Applications15-SP1-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Server-Applications15-SP1-Source-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Module-Server-Applications15-SP1-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Product-SLES15-SP1-Debuginfo-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Product-SLES15-SP1-Debuginfo-Updates for sle-15-x86_64' [......done] Adding repository 'SLE-Product-SLES15-SP1-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Product-SLES15-SP1-Source-Pool for sle-15-x86_64' [......done] Adding repository 'SLE-Product-SLES15-SP1-Updates for sle-15-x86_64' [......done] Adding repository 'SLE15-SP1-Installer-Updates for sle-15-x86_64' [......done]

All services have been refreshed. Retrieving repository 'SLE-Module-Basesystem15-SP1-Pool for sle-15-x86_64' metadata [. Authentication required for 'https://smt-gce.susecloud.net/repo/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/' User Name: Authentication required for 'https://smt-gce.susecloud.net/repo/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/' User Name: error] Repository 'SLE-Module-Basesystem15-SP1-Pool for sle-15-x86_64' is invalid. [container-suseconnect-zypp:SLE-Module-Basesystem15-SP1-Pool|https://smt-gce.susecloud.net/repo/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product/] Valid metadata not found at specified URL History:

acmnu commented 4 years ago

If you need any assistance here feel free to call me, besides I am ready to give you access to host on GCE if you need so.

rhafer commented 4 years ago

If you need any assistance here feel free to call me, besides I am ready to give you access to host on GCE if you need so.

Thanks for the offer. But I think I already understand the issue. Working on a fix.

rhafer commented 4 years ago

The PR linked above should fix the authentication issue.

I am also working on a patch to import the smt CA from the host (but that will likely require a small change in docker and the podman config)

rhafer commented 3 years ago

Fixed since https://github.com/SUSE/container-suseconnect/pull/42