SUSE / container-suseconnect

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

"Building images on non SLE distributions" doesn't work for SLE12-SP3 #50

Closed mwilck closed 3 years ago

mwilck commented 3 years ago

Building SLE12-SP3 containers according to the docs fails. Sample Dockerfile:

# syntax = docker/dockerfile:experimental
FROM registry.suse.com/suse/sles12sp3
ARG ADDITIONAL_MODULES=

RUN --mount=type=secret,id=SUSEConnect,required \
    --mount=type=secret,id=SCCcredentials,required \
     zypper -n --gpg-auto-import-keys \
     install less

Trying to build this:

sle12-sp3> docker build -t sle12-sp3-test \
        --secret id=SUSEConnect,src=SUSEConnect \
        --secret id=SCCcredentials,src=SCCcredentials \
... 
#7 [2/2] RUN --mount=type=secret,id=SUSEConnect,required   --mount=type=secret,id=SCCcredentials,required      zypper -n --gpg-auto-import-keys      install less:
#7 1.934 Refreshing service 'container-suseconnect'.
#7 2.517 Problem retrieving the repository index file for service 'container-suseconnect':
#7 2.517 [container-suseconnect|file:/usr/lib/zypp/plugins/services/container-suseconnect] 
#7 2.517 Warning: Skipping service 'container-suseconnect' because of the above error.
#7 2.517 Loading repository data...
#7 2.517 Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
#7 2.518 Reading installed packages...
#7 2.523 No provider of 'less' found.
#7 2.523 'less' not found in package names. Trying capabilities.
------
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to build LLB: executor failed running [/bin/sh -c zypper -n --gpg-auto-import-keys      install less]: docker-runc did not terminate sucessfully

For SLE12-SP4 (just replacing the image in the FROM line), this works fine, with the same credentials. I also verified that my credentials do work for SLE12-SP3. The problem is that refreshing container-suseconnect service failed, and thus no repositories are defined.

rhafer commented 3 years ago
# podman run --rm registry.suse.com/suse/sles12sp3 rpm -q container-suseconnect
container-suseconnect-1.1.0-6.10.x86_64

Hm, that's a very old container-suseconnect release. For some reason the SP3 base image hasn't be updated. Would you mind opening a bugzilla issue for this (if SP3 is actually still supported). I am pretty sure this bug is fixed in recent container-suseconnect versions. For reference:

# podman run --rm registry.suse.com/suse/sles12sp4 rpm -q container-suseconnect
container-suseconnect-2.0.0-1.82.x86_64
mwilck commented 3 years ago

What would the bugzilla component be? Wrt support, I think if it's unsupported the image had better be removed or otherwise marked so.

rhafer commented 3 years ago

What would the bugzilla component be?

Use "Containers" and add me to CC. I'll take it from there.

Wrt support, I think if it's unsupported the image had better be removed or otherwise marked so.

Yeah, maybe. I guess we'll find out in Bugzilla. :-)

Closing this issue as this is a problem with the image (the bug it self was fixed a while ago)

mwilck commented 3 years ago

https://bugzilla.suse.com/show_bug.cgi?id=1178302