forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (40 loc) · 781 Bytes
/
Dockerfile
File metadata and controls
54 lines (40 loc) · 781 Bytes
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
54
FROM public.ecr.aws/sam/build-python3.7
USER root
RUN mkdir -p /opt
WORKDIR /tmp
#
# tools
#
RUN yum update -y \
&& yum install -y zip unzip wget tar gzip
#
# aws cli
#
COPY requirements.txt ./
RUN python -m pip install -r requirements.txt -t /opt/awscli
#
# organize for self-contained usage
#
RUN mv /opt/awscli/bin/aws /opt/awscli
#
# cleanup
#
RUN rm -rf \
/opt/awscli/pip* \
/opt/awscli/setuptools* \
&& cd /opt/awscli/awscli/examples \
&& rm -rf $(ls | grep -v global_options.rst)
#
# Test that the CLI works
#
RUN yum install -y groff
RUN /opt/awscli/aws help
#
# create the bundle
#
RUN cd /opt \
&& zip --symlinks -r ../layer.zip * \
&& echo "/layer.zip is ready" \
&& ls -alh /layer.zip;
WORKDIR /
ENTRYPOINT [ "/bin/bash" ]