forked from aws-quickstart/quickstart-redhat-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (29 loc) · 891 Bytes
/
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
FROM python:3.7-slim-stretch
# set the workdir to src
WORKDIR /functions
# install cloud custodian
RUN set -ex; \
apt-get --yes update; \
apt-get --yes install --no-install-recommends \
bash \
zip; \
apt-get purge --yes --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/cache/apt/; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /src/; \
rm -rf /root/.cache/
# add the policies
COPY functions/ /functions/
RUN set -ex; \
for folder in `ls /functions/source/` ; do \
if [ ! -d /functions/packages/$folder ]; then \
mkdir /functions/packages/$folder ; \
fi ;\
cd /functions/source/$folder; \
if [ -f requirements.txt ]; then \
pip3 install -r requirements.txt -t . ; \
fi ;\
zip -r ../../packages/$folder/lambda.zip *; \
done
# set the entrypoint
ENTRYPOINT ["/bin/bash"]