Skip to content

Conversation

@BbolroC
Copy link
Member

@BbolroC BbolroC commented Aug 21, 2025

The base image used for building KBS (rust:slim) was recently updated, and its toolchain now requires glibc 2.38. However, the runtime base image is still ubuntu:22.04, which only provides glibc 2.35.

This mismatch causes runtime errors, e.g.:

/usr/local/bin/kbs: /lib/s390x-linux-gnu/libc.so.6:
version `GLIBC_2.38' not found (required by /usr/local/bin/kbs)

This PR updates the runtime image to ubuntu:24.04 to match the required glibc version.
Additionally, the update pins the image by digest rather than tag to prevent similar regressions.

Signed-off-by: Hyounggyu Choi [email protected]

@BbolroC BbolroC requested a review from a team as a code owner August 21, 2025 12:32
@BbolroC
Copy link
Member Author

BbolroC commented Aug 21, 2025

For reviewers: would it be better to use an image digest here to pin a known working version?
If we continue to rely on tags and want to avoid similar issues in the future, we may need to introduce proper CI to verify deployment and basic functionality of the service on K8S.
I would appreciate any feedback on this. Thanks!

@stevenhorsman
Copy link
Member

For reviewers: would it be better to use an image digest here to pin a known working version?

Yes - it feel like relying on a tag (rust:slim/rust:latest) that gets updated isn't a very stable approach (and there is a similar argument about using the digest in ubuntu for supply chain security purposes), and this is also flagged in the Pinned-Dependencies section of scorecard: https://scorecard.dev/viewer/?uri=github.com/confidential-containers/trustee
so it might improve the scorecard score as a bonus!

make ARCH=${ARCH} install-kbs

FROM ubuntu:22.04
FROM ubuntu:24.04
Copy link
Contributor

@pawelpros pawelpros Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file for sure additional change needs to be made - include gpg package in apt-get -> without gpg building will fail with 14.17 /bin/sh: 1: gpg: not found

RUN apt-get update && \
    apt-get install -y \
    curl \
    gpg \
    gnupg-agent && \
    if [ "${ARCH}" = "x86_64" ]; then curl -fsSL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | \
    gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg && \
    echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
    libsgx-dcap-default-qpl \
    libsgx-dcap-quote-verify \
    libtss2-tctildr0 \
    libtss2-esys-3.0.2-0 ; \
    fi && \
    apt clean all && \
    rm -rf /tmp/*

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apt-key: not found should be handled, too.

Copy link
Member Author

@BbolroC BbolroC Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should be rebased (plus, gpg installation added) and tested after #923 is merged.

@BbolroC
Copy link
Member Author

BbolroC commented Aug 21, 2025

For reviewers: would it be better to use an image digest here to pin a known working version?

One meaningful feedback from @mythi:

the PR looks fine but I wonder if we should move to use the same base image and rustup the toolchain?

@BbolroC BbolroC force-pushed the use-hash-for-dockerfile branch 2 times, most recently from af0c8cd to 78c763c Compare August 22, 2025 08:30
FROM --platform=${BUILDPLATFORM:-linux/amd64} docker.io/library/rust:latest AS builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} \
docker.io/library/rust@sha256:6e6d04bd50cd4c433a805c58c13f186a508c5b5417b9b61cae40ec28e0593c51 \
AS builder # rust:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed that we also use rust:1.85.1 in kbs-client-image's dockerfile. Could we mention the rust version than latest in all dockerfiles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it totally makes sense. thanks!

@BbolroC BbolroC force-pushed the use-hash-for-dockerfile branch 4 times, most recently from d40e27a to 37b8996 Compare August 22, 2025 08:58
The base image used for building KBS (`rust:slim`) was recently
updated, and its toolchain now requires glibc 2.38.
However, the runtime base image is still `ubuntu:22.04`, which
only provides glibc 2.35.

This mismatch causes runtime errors, e.g.:

```
/usr/local/bin/kbs: /lib/s390x-linux-gnu/libc.so.6:
version `GLIBC_2.38' not found (required by /usr/local/bin/kbs)
```

This commit updates the runtime image to `ubuntu:24.04` to
match the required glibc version. Additionally, the update pins
the image by digest rather than tag to prevent similar regressions.

Signed-off-by: Hyounggyu Choi <[email protected]>
@BbolroC BbolroC force-pushed the use-hash-for-dockerfile branch from 37b8996 to 10becf4 Compare August 22, 2025 09:01
@Xynnn007
Copy link
Member

The "KBS Rust Suites / Check (ubuntu-24.04-arm, coco-as-builtin,coco-as-grpc,intel-trust-authority-as,sample_only,cca-at... (pull_request)Failing after 2m" error is a known issue not related to the PR and discussed in #918

@Xynnn007
Copy link
Member

Let me get this merged and then please @fitzthum take a rebase on #931 . Ideally the CI will be green due to previous test #932 made by @mythi

@Xynnn007 Xynnn007 merged commit 8e1dbc7 into confidential-containers:main Aug 28, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants