SUSE / container-suseconnect

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

Building SLES 12SP5 Docker images in Google Compute Engine #47

Closed bradfordb-vmware closed 4 years ago

bradfordb-vmware commented 4 years ago

I am using a combination of Creating a Custom SLE 12 Image and Example Dockerfiles to build a SLES 12SP5 Docker image using a Google Compute Engine (GCE) on-demand VM (image is sles-12-sp5-v20200610).

The Dockefile is

FROM registry.suse.com/suse/sles12sp5:latest

# Import the crt file of our private SMT server
ADD http://smt-gce/smt.crt /etc/pki/trust/anchors/smt.crt
RUN update-ca-certificates

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

which I am building with

docker build --network host --tag custum-sles12sp5:latest .

but it is failing with the following error

Step 4/5 : RUN zypper --gpg-auto-import-keys ref -s
 ---> Running in 4b9177892812
Refreshing service 'container-suseconnect-zypp'.
Adding repository 'SLES12-SP5-Debuginfo-Pool for sle-12-x86_64' [......done]
Adding repository 'SLES12-SP5-Debuginfo-Updates for sle-12-x86_64' [......done]
Adding repository 'SLES12-SP5-Installer-Updates for sle-12-x86_64' [......done]
Adding repository 'SLES12-SP5-Pool for sle-12-x86_64' [......done]
Adding repository 'SLES12-SP5-Source-Pool for sle-12-x86_64' [......done]
Adding repository 'SLES12-SP5-Updates for sle-12-x86_64' [......done]
All services have been refreshed.
Retrieving repository 'SLES12-SP5-Pool for sle-12-x86_64' metadata [.
Medium not attached: plugin:/susecloud?credentials=&path=/repo/SUSE/Products/SLE-SERVER/12-SP5/x86_64/product/

The digest of the base Docker image (registry.suse.com/suse/sles12sp5:latest) is sha256:2e6da53d3dba5c5eec8d7b5e81d4c920fec52b10bddb167bc6f4f3191e28f08e

Following Building images on-demand SLE instances in the public cloud, when I start the containerbuild-regionsrv service I get the following error:

$ sudo systemctl start containerbuild-regionsrv
Failed to start containerbuild-regionsrv.service: Unit containerbuild-regionsrv.service failed to load: No such file or directory.

Questions

  1. Is there a newer GCE VM image I should be using when building Docker images?
  2. Is there a newer Docker image that I should be using in my FROM statement?
  3. Is there a way to install the susecloud plugin in the image I am building?
rhafer commented 4 years ago
  • Is there a newer GCE VM image I should be using when building Docker images?
  • Is there a newer Docker image that I should be using in my FROM statement?

There will be updated images. The updated Cloud Images (which includes the new containerbuild-regionsrv service) and the updated base container images (which includes the susecloud zypper plugin) are not released yet. We are working on getting them released, but it might still take a while.

  • Is there a way to install the susecloud plugin in the image I am building?

Until the updates are released you cloud try using the test for the "Virtualization:containers" project in OBS. SLE12 packages should be available here: https://download.opensuse.org/repositories/Virtualization:/containers/SLE_12_SP4/x86_64/container-suseconnect-2.3.0-1.1.x86_64.rpm. You should be able to download that, copy that in the Container build and install it via a RUN rpm ... call inside the Dockerfile.

However you'll also need the containerbuild-regionsrv installed on the host instance. I guess the quickest way would be to get it directly from the git repository as I don't think we have that package in OBS. The github repo is: https://github.com/SUSE-Enceladus/cloud-regionsrv-client/. I think you'll only need the usr/sbin/containerbuild-regionsrv file. The .service file is also living there.

bradfordb-vmware commented 4 years ago

Thanks for suggestions. I'll give them a try.

We are working on getting them released, but it might still take a while.

Is there a mailing list/RSS feed that I could watch to know when the update images have been released?

bradfordb-vmware commented 4 years ago

I tried installing cloud-regionsrv-client from the linked GitHub repo but was unable to run it. I've open two issues there with more info:

  1. https://github.com/SUSE-Enceladus/cloud-regionsrv-client/issues/35
  2. https://github.com/SUSE-Enceladus/cloud-regionsrv-client/issues/36
rhafer commented 4 years ago

The above issues have been addressed so I'll close this issue. (Feel free to re-open in case I overlooked something)