-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (40 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
######## full image ########
FROM amazonlinux:2 as full_image
RUN amazon-linux-extras install aws-nitro-enclaves-cli && \
yum install aws-nitro-enclaves-cli-devel jq -y
WORKDIR /ne-deps
# Copy only the required binaries to /ne-deps folder.
#
RUN BINS="\
/usr/bin/nitro-cli \
/usr/bin/nitro-enclaves-allocator \
/usr/bin/jq \
" && \
for bin in $BINS; do \
{ echo "$bin"; ldd "$bin" | grep -Eo "/.*lib.*/[^ ]+"; } | \
while read path; do \
mkdir -p ".$(dirname $path)"; \
cp -fL "$path" ".$path"; \
done \
done
# Prepare other required files and folders for the final image.
#
RUN \
mkdir -p /ne-deps/etc/nitro_enclaves && \
mkdir -p /ne-deps/run/nitro_enclaves && \
mkdir -p /ne-deps/var/log/nitro_enclaves && \
cp -rf /usr/share/nitro_enclaves/ /ne-deps/usr/share/ && \
cp -f /etc/nitro_enclaves/allocator.yaml /ne-deps/etc/nitro_enclaves/allocator.yaml
######## hello image ########
FROM amazonlinux:2 as image
# Copying dependencies of the enclave apps from the 'full_image'
# to shrink the final image size.
#
COPY --from=full_image /ne-deps /
COPY bin/fake-validator.eif /home
COPY eks_validator_design/run.sh /home
EXPOSE 8085
RUN chmod +x /home/run.sh
CMD ["/home/run.sh"]