it-at-m / oss-repository-en-template

This repo is a base template for all open-source repositories in the it@m organization
MIT License
2 stars 2 forks source link

change image version to 9 and runtime #9

Closed hupling closed 1 year ago

hupling commented 1 year ago

Description

https://developers.redhat.com/articles/2021/05/24/build-lean-java-containers-new-red-hat-universal-base-images-openjdk-runtime#

Update das Image von ubi8 zu ubi9.

Wechsel zum Runtime, da das Image kleine ist, weil z.b. Maven fehlt. Die JAR Datei in der Pipeline gebaut wird und nicht in diesem Dockerimage.

Intern können wir auch mal zu dem Image umstellen.

Vor dem Merge sollte jemand das testen

hupling commented 1 year ago

zur Info @eidottermihi @klml @ejcsid

hupling commented 1 year ago
 eval oc start-build bc/$OPENSHIFT_BUILDCONFIG --from-file=$JAR_FILE --follow --wait
Uploading file "target/beispielprojekt-backend-0.0.1-SNAPSHOT.jar" as binary input for the build ...
.
Uploading finished
build.build.openshift.io/beispielprojekt-backend-dev-12 started
Adding cluster TLS certificate authority to trust store
Receiving source from STDIN as file beispielprojekt-backend-0.0.1-SNAPSHOT.jar
Adding cluster TLS certificate authority to trust store
Adding cluster TLS certificate authority to trust store
time="2023-06-13T07:01:58Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
I0613 07:01:58.886188       1 defaults.go:102] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
Caching blobs under "/var/cache/blobs".
Trying to pull registry.access.redhat.com/ubi9/openjdk-11-runtime:latest...
Getting image source signatures
Copying blob sha256:fefe8c7e29d62e0c8b41557ecc4055f90c54a1b298e87b69ba1888c97d99cb1d
Copying blob sha256:a9f076b473b10f92470b5c7fe238962e80f6eedd374d74105fcfad39afb4f699
Copying config sha256:bbbb2be83df9517bcc4ef597427573e54d1e3cf163b1512829e5b38b380feddc
Writing manifest to image destination
Storing signatures
Generating dockerfile with builder image registry.access.redhat.com/ubi9/openjdk-11-runtime:latest
Adding transient rw bind mount for /run/secrets/rhsm
STEP 1/9: FROM registry.access.redhat.com/ubi9/openjdk-11-runtime:latest
STEP 2/9: LABEL "io.openshift.build.image"="registry.access.redhat.com/ubi9/openjdk-11-runtime:latest"       "io.openshift.build.source-location"="/tmp/build/inputs"
STEP 3/9: ENV OPENSHIFT_BUILD_NAME="beispielprojekt-backend-dev-12"     OPENSHIFT_BUILD_NAMESPACE="xxx"
STEP 4/9: USER root
STEP 5/9: COPY upload/src /tmp/src
STEP 6/9: RUN chown -R 185:0 /tmp/src
STEP 7/9: USER 185
STEP 8/9: RUN /usr/libexec/s2i/assemble
/bin/sh: line 1: /usr/libexec/s2i/assemble: No such file or directory
error: build error: error building at STEP "RUN /usr/libexec/s2i/assemble": error while running runtime: exit status 127
error: the build km83/beispielprojekt-backend-dev-12 status is "Failed"

Leider funktioniert die Strategy Source nicht mehr mit dem Image. Man müsste dann mit Dockerfiles arbeiten. So wie hier.