Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faile to build Docker image with aws-nitro-enclaves-sdk-c on Ubuntu 20.04 #137

Open
yanghongsing opened this issue Mar 20, 2024 · 0 comments

Comments

@yanghongsing
Copy link

I used the Dockerfile attached to build and install aws-nitro-enclaves-sdk-c on Ubuntu20.04. It filed with error message below:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LibNSM
linked by target "aws-nitro-enclaves-sdk-c" in directory /tmp/crt-builder/aws-nitro-enclaves-sdk-c
linked by target "kmstool_instance" in directory /tmp/crt-builder/aws-nitro-enclaves-sdk-c/bin/kmstool-instance

Below is the detailed log:
ubuntu@ip-172-32-43-250:~/aws-nitro-ai/enclave-base-image$ docker build -t enclave_base .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/

Sending build context to Docker daemon 42.5kB
Step 1/54 : ARG BASE_IMAGE=public.ecr.aws/ubuntu/ubuntu:20.04
Step 2/54 : FROM $BASE_IMAGE as builder
---> 3cff1c6ff37e
Step 3/54 : SHELL ["/bin/bash", "-c"]
---> Using cache
---> cf1ce74be2e0
Step 4/54 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 8aeccdd9a667
Step 5/54 : ENV DEBCONF_NOWARNINGS="yes"
---> Using cache
---> a425d8adf865
Step 6/54 : RUN set -xeu
---> Using cache
---> 9fe28ec1d2c7
Step 7/54 : RUN apt-get update && apt-get install -y build-essential cmake ninja-build libcurl4-openssl-dev libelf-dev doxygen graphviz mscgen dia && rm -rf /var/lib/apt/lists/*
---> Using cache
---> f54d538cdea0
Step 8/54 : RUN apt update && apt install -y golang-go git
---> Using cache
---> 99859e9781c8
Step 9/54 : RUN apt-get update && apt-get install -y curl unzip jq make
---> Using cache
---> ef7df7337dc0
Step 10/54 : RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.63
---> Using cache
---> 875fda1bd5e7
Step 11/54 : RUN echo "source $HOME/.cargo/env" >> $HOME/.bashrc
---> Using cache
---> e84d1fee7fdb
Step 12/54 : WORKDIR /tmp/crt-builder
---> Using cache
---> f050931cea27
Step 13/54 : RUN go version
---> Using cache
---> bfe4b03e2086
Step 14/54 : RUN git clone --depth 1 -b v0.4.1 https://github.com/aws/aws-nitro-enclaves-sdk-c
---> Using cache
---> 905d45150a7b
Step 15/54 : RUN git clone --depth 1 -b v1.22.0 https://github.com/awslabs/aws-lc.git aws-lc
---> Using cache
---> 11da67a8d15f
Step 16/54 : RUN cmake -DDISABLE_PERL=ON -DDISABLE_GO=ON -DDISABLE_PERL=ON -DDISABLE_GO=ON -DCMAKE_PREFIX_PATH=/usr -DCMAKE_INSTALL_PREFIX=/usr -GNinja -DBUILD_TESTING=0 -S aws-lc -B aws-lc/build . && go env -w GOPROXY=direct && cmake --build aws-lc/build --parallel $(nproc) --target install
---> Using cache
---> b1e660b22d69
Step 17/54 : RUN git clone --depth 1 -b v1.3.46 https://github.com/aws/s2n-tls.git
---> Using cache
---> 1ad5b64ba271
Step 18/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -S s2n-tls -B s2n-tls/build
---> Using cache
---> bc3ff287ad6c
Step 19/54 : RUN cmake --build s2n-tls/build --parallel $(nproc) --target install
---> Using cache
---> 397b6f6342fd
Step 20/54 : RUN git clone --depth 1 -b v0.8.0 https://github.com/awslabs/aws-c-common.git
---> Using cache
---> 6bf86b3097dd
Step 21/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-common -B aws-c-common/build
---> Using cache
---> 318fe0c809b8
Step 22/54 : RUN cmake --build aws-c-common/build --parallel $(nproc) --target install
---> Using cache
---> a3fc80053e08
Step 23/54 : RUN git clone --depth 1 -b v0.1.2 https://github.com/awslabs/aws-c-sdkutils.git
---> Using cache
---> 8236eaf255ce
Step 24/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-sdkutils -B aws-c-sdkutils/build
---> Using cache
---> 90bf3c9f7193
Step 25/54 : RUN cmake --build aws-c-sdkutils/build --parallel $(nproc) --target install
---> Using cache
---> cb68abf53d6a
Step 26/54 : RUN git clone --depth 1 -b v0.5.18 https://github.com/awslabs/aws-c-cal.git
---> Using cache
---> afc32147fc17
Step 27/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-cal -B aws-c-cal/build
---> Using cache
---> 1f52ff2e6628
Step 28/54 : RUN cmake --build aws-c-cal/build --parallel $(nproc) --target install
---> Using cache
---> c1f11c3ce3fc
Step 29/54 : RUN git clone --depth 1 -b v0.11.0 https://github.com/awslabs/aws-c-io.git
---> Using cache
---> 92496f912210
Step 30/54 : RUN cmake -DUSE_VSOCK=1 -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-io -B aws-c-io/build
---> Using cache
---> 6438bfeacc43
Step 31/54 : RUN cmake --build aws-c-io/build --parallel $(nproc) --target install
---> Using cache
---> 58623284f9d8
Step 32/54 : RUN git clone --depth 1 -b v0.2.14 http://github.com/awslabs/aws-c-compression.git
---> Using cache
---> 71387265235d
Step 33/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-compression -B aws-c-compression/build
---> Using cache
---> c1dd283c13b5
Step 34/54 : RUN cmake --build aws-c-compression/build --parallel $(nproc) --target install
---> Using cache
---> c6dea45cf7ed
Step 35/54 : RUN git clone --depth 1 -b v0.7.6 https://github.com/awslabs/aws-c-http.git
---> Using cache
---> e3161e007537
Step 36/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-http -B aws-c-http/build
---> Using cache
---> 445e9b59e9b2
Step 37/54 : RUN cmake --build aws-c-http/build --parallel $(nproc) --target install
---> Using cache
---> b0453a4753c9
Step 38/54 : RUN git clone --depth 1 -b v0.6.15 https://github.com/awslabs/aws-c-auth.git
---> Using cache
---> e64f81ed48d5
Step 39/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-c-auth -B aws-c-auth/build
---> Using cache
---> 332a5b83bc72
Step 40/54 : RUN cmake --build aws-c-auth/build --parallel $(nproc) --target install
---> Using cache
---> b6a562358527
Step 41/54 : RUN git clone --depth 1 -b json-c-0.16-20220414 https://github.com/json-c/json-c.git
---> Using cache
---> daf3826ed5ae
Step 42/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=OFF -GNinja -S json-c -B json-c/build
---> Using cache
---> e1cc723fe7d2
Step 43/54 : RUN cmake --build json-c/build --parallel $(nproc) --target install
---> Using cache
---> 887874a91741
Step 44/54 : RUN git clone --depth 1 -b v0.4.0 https://github.com/aws/aws-nitro-enclaves-nsm-api.git
---> Using cache
---> c7e7131e25da
Step 45/54 : RUN source $HOME/.cargo/env && cd aws-nitro-enclaves-nsm-api && cargo build --release --jobs $(nproc) -p nsm-lib
---> Using cache
---> e483c6a7a5b5
Step 46/54 : RUN mv aws-nitro-enclaves-nsm-api/target/release/libnsm.so /usr/lib64
---> Using cache
---> 219d976d8468
Step 47/54 : RUN mv aws-nitro-enclaves-nsm-api/target/release/nsm.h /usr/include
---> Using cache
---> 286b6b191b31
Step 48/54 : RUN cmake -DCMAKE_PREFIX_PATH=/usr -DCMAKE_INSTALL_PREFIX=/usr -GNinja -S aws-nitro-enclaves-sdk-c -B aws-nitro-enclaves-sdk-c/build
---> Running in 7cb76fbd2108
-- The C compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
fatal: No annotated tags can describe '550f7313bf792bf03200c7c6e1ac3fd7d2dc382f'.
However, there were unannotated tags: try --tags.
-- Version=v0.2.1-unknown
-- Found LibJsonC: /usr/lib/x86_64-linux-gnu/libjson-c.a
-- LibJsonC Include Dir: /usr/include
-- LibJsonC Shared Lib: LibJsonC_SHARED_LIBRARY-NOTFOUND
-- LibJsonC Static Lib: /usr/lib/x86_64-linux-gnu/libjson-c.a
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found crypto: /usr/lib/x86_64-linux-gnu/libcrypto.a
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: crypto_SHARED_LIBRARY-NOTFOUND
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.a
-- S2N found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- S2N found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- S2N found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- aws-c-cal found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- aws-c-cal found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- aws-c-cal found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- aws-c-cal found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- aws-c-cal found target: AWS::crypto
-- crypto Include Dir: /usr/include
-- Performing Test HAS_FPIC_FLAG
-- Performing Test HAS_FPIC_FLAG - Success
-- Performing Test HAS_64BIT_FILE_OFFSET_BY_DEFAULT
-- Performing Test HAS_64BIT_FILE_OFFSET_BY_DEFAULT - Success
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Performing Test HAS_WGNU
-- Performing Test HAS_WGNU - Failed
-- Performing Test HAVE_SYSCONF
-- Performing Test HAVE_SYSCONF - Success
-- Performing Test HAS_SANITIZERS
-- Performing Test HAS_SANITIZERS - Failed
-- Performing Test HAS_WNO_STRINGOP_OVERFLOW
-- Performing Test HAS_WNO_STRINGOP_OVERFLOW - Success
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen dot mscgen dia
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LibNSM
linked by target "aws-nitro-enclaves-sdk-c" in directory /tmp/crt-builder/aws-nitro-enclaves-sdk-c
linked by target "kmstool_instance" in directory /tmp/crt-builder/aws-nitro-enclaves-sdk-c/bin/kmstool-instance
Dockerfile_1.txt

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

No branches or pull requests

1 participant