Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions kbs/docker/rhel-ubi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,32 @@ RUN if [[ -n "${ACTIVATION_KEY}" && -n "${ORG_ID}" ]]; then \

# Install build dependencies from CentOS or RHEL repos.

RUN subscription-manager repos --enable codeready-builder-for-rhel-9-${ARCH/amd64/x86_64}-rpms; \
RUN subscription-manager repos --enable codeready-builder-for-rhel-10-${ARCH/amd64/x86_64}-rpms; \
dnf -y update && \
dnf -y --setopt=install_weak_deps=0 install \
cargo pkg-config perl-FindBin openssl-devel perl-lib perl-IPC-Cmd perl-File-Compare perl-File-Copy clang-devel \
rust gcc gcc-c++ \
cmake glibc-static perl device-mapper-devel \
tpm2-tss-devel \
protobuf-compiler \
# This is needed to build the stub.
meson
protobuf-compiler

# Build.
WORKDIR /usr/src/kbs
COPY . .
ARG KBS_FEATURES=coco-as-builtin,intel-trust-authority-as
RUN \
# Build sgx_dcap_quoteverify stub.
pushd sgx_dcap_quoteverify_stubs && \
meson setup build --prefix=/usr && \
meson compile -C build && \
meson install -C build && \
popd

# Build KBS.
ENV OPENSSL_NO_VENDOR=1
# RUN ARCH=$(uname -m) && \
# if [ ${ARCH} = "s390x" ]; then \
# export OPENSSL_NO_VENDOR=1; \
# fi && \
RUN ARCH=$(uname -m) && \
pushd kbs && make AS_FEATURE=${KBS_FEATURES} ALIYUN=${ALIYUN} ARCH=${ARCH} && make ARCH=${ARCH} install-kbs && popd


# Check the sha256sum of the Intel provided RPMs on x86_64.
RUN if [ $(uname -m) = "x86_64" ]; then \
pushd sgx_dcap_quoteverify_stubs && \
echo "2621eac23cb756bc238f88d6db5401f7efed55d87855fc2b7e446ddfc1bd37ca" libsgx-dcap-default-qpl-1.21.100.3-1.el9.x86_64.rpm | sha256sum --check && \
echo "57da5fb2253a99bb2483d19b6f30d1170ebc384e2891937e2c89fa55886b7034" libsgx-dcap-quote-verify-1.21.100.3-1.el9.x86_64.rpm | sha256sum --check && \
popd; \
fi

# Package UBI image.
FROM registry.access.redhat.com/ubi10:10.1-1769521623

# Update packages. Get CVE fixes sooner.
RUN dnf -y update && dnf clean all

COPY --from=builder /usr/local/bin/kbs /usr/local/bin/kbs
COPY --from=builder /usr/src/kbs/sgx_dcap_quoteverify_stubs/libsgx-dcap-quote-verify-1.21.100.3-1.el9.x86_64.rpm /tmp/libsgx-dcap-quote-verify-1.21.100.3-1.el9.x86_64.rpm
COPY --from=builder /usr/src/kbs/sgx_dcap_quoteverify_stubs/libsgx-dcap-default-qpl-1.21.100.3-1.el9.x86_64.rpm /tmp/libsgx-dcap-default-qpl-1.21.100.3-1.el9.x86_64.rpm

# Install Intel binaries
RUN \
if [ $(uname -m) = "x86_64" ]; then \
dnf -y --nogpgcheck --setopt=install_weak_deps=0 localinstall \
/tmp/libsgx-dcap-quote-verify-1.21.100.3-1.el9.x86_64.rpm \
/tmp/libsgx-dcap-default-qpl-1.21.100.3-1.el9.x86_64.rpm; \
fi && \
rm -f /tmp/libsgx-dcap-quote-verify-1.21.100.3-1.el9.x86_64.rpm /tmp/libsgx-dcap-default-qpl-1.21.100.3-1.el9.x86_64.rpm

# Declare build-time variables.
ARG NAME="trustee"
Expand Down
Loading
Loading