66# #
77# # based on https://github.com/aws/aws-nitro-enclaves-acm/blob/main/env/enclave/Dockerfile
88# ###################################################################################################
9- FROM public.ecr.aws/docker/library/rust:alpine as kmstool
9+ FROM public.ecr.aws/docker/library/rust:alpine AS kmstool
1010
1111ARG TARGETPLATFORM
1212ENV RUSTFLAGS="-C target-feature=-crt-static"
@@ -32,7 +32,7 @@ RUN ln -s /usr/lib /usr/lib64
3232WORKDIR /tmp/crt-builder
3333
3434# Build AWS libcrypto
35- RUN git clone --depth 1 -b v1.12.0 https://github.com/awslabs/aws-lc.git
35+ RUN git clone --depth 1 -b v1.41.1 https://github.com/awslabs/aws-lc.git
3636RUN cmake \
3737 -DCMAKE_PREFIX_PATH=/usr \
3838 -DCMAKE_INSTALL_PREFIX=/usr \
@@ -123,7 +123,7 @@ RUN cmake \
123123RUN cmake --build aws-c-auth/build --parallel $(nproc) --target install
124124
125125# JSON-C library
126- RUN git clone --depth 1 -b json-c-0.16-20220414 https://github.com/json-c/json-c.git
126+ RUN git clone --depth 1 -b json-c-0.18-20240915 https://github.com/json-c/json-c.git
127127RUN cmake \
128128 -DCMAKE_PREFIX_PATH=/usr \
129129 -DCMAKE_INSTALL_PREFIX=/usr \
@@ -134,6 +134,7 @@ RUN cmake --build json-c/build --parallel $(nproc) --target install
134134
135135# NSM LIB
136136RUN git clone --depth 1 -b v0.4.0 "https://github.com/aws/aws-nitro-enclaves-nsm-api"
137+ RUN rustup target add $TARGETPLATFORM
137138RUN cd aws-nitro-enclaves-nsm-api \
138139 && PATH="$PATH:/root/.cargo/bin" cargo build --release --target $TARGETPLATFORM --jobs $(nproc) -p nsm-lib \
139140 && mv target/$TARGETPLATFORM/release/libnsm.so /usr/lib/ \
@@ -152,22 +153,25 @@ RUN cmake --build aws-nitro-enclaves-sdk-c/build --parallel $(nproc) --target in
152153# ###################################################################################################
153154# # Chef image
154155# ###################################################################################################
155- FROM public.ecr.aws/docker/library/rust:alpine as chef
156+ FROM public.ecr.aws/docker/library/rust:alpine AS chef
157+ ARG TARGETPLATFORM
158+
156159WORKDIR /app
157160RUN apk add --no-cache build-base
161+ RUN rustup target add $TARGETPLATFORM
158162RUN cargo install cargo-chef --locked
159163
160164# ###################################################################################################
161165# # Planner image
162166# ###################################################################################################
163- FROM chef as planner
167+ FROM chef AS planner
164168COPY . .
165169RUN cargo chef prepare --recipe-path recipe.json
166170
167171# ###################################################################################################
168172# # Builder image
169173# ###################################################################################################
170- FROM chef as builder
174+ FROM chef AS builder
171175ARG TARGETPLATFORM
172176
173177COPY --from=planner /app/recipe.json recipe.json
0 commit comments