-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Dockerfile-provided
60 lines (51 loc) · 2.11 KB
/
Dockerfile-provided
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
55
56
57
58
59
60
FROM amazon/aws-sam-cli-emulation-image-provided:latest
# Install build tools
# The base image essentially corrupts the RPM DB,
# so we need to make changes for yum to run successfully.
RUN chmod 1777 /tmp && \
/usr/bin/python3 -c "from configparser import SafeConfigParser; \
yum_conf = SafeConfigParser(); \
yum_conf.read('/etc/yum.conf'); \
yum_conf.has_section('main') or yum_conf.add_section('main'); \
yum_conf.set('main', 'plugins', '1'); \
f = open('/etc/yum.conf', 'w'); \
yum_conf.write(f); \
f.close();" && \
rpm --rebuilddb && \
yum groupinstall -y development && \
yum install -d1 -y \
tar \
gzip \
unzip \
python3 \
grep \
curl \
make \
gcc-c++ \
binutils \
procps \
libgmp3-dev \
zlib1g-dev \
liblzma-dev \
libxslt-devel \
libmpc-devel \
&& yum clean all
# Include build tools for the Function Build image.
# /opt is used for Lambda Layers. To avoid any potential confusion or
# conflict in the future, the build tools are installed in /usr/local/opt
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws
# Install SAM CLI in a dedicated Python virtualenv
ENV SAM_CLI_VERSION=0.53.0
RUN curl -Lk "https://github.com/awslabs/aws-sam-cli/archive/v$SAM_CLI_VERSION.zip" -o "samcli.zip" && \
unzip samcli.zip && python3 -m venv /usr/local/opt/sam-cli && \
sed 's/regex==2019.8.19/regex==2020.4.4/' ./aws-sam-cli-$SAM_CLI_VERSION/requirements/isolated.txt > ./aws-sam-cli-$SAM_CLI_VERSION/requirements/isolated.txt && \
/usr/local/opt/sam-cli/bin/pip3 --no-cache-dir install -r ./aws-sam-cli-$SAM_CLI_VERSION/requirements/isolated.txt && \
/usr/local/opt/sam-cli/bin/pip3 --no-cache-dir install ./aws-sam-cli-$SAM_CLI_VERSION
RUN rm samcli.zip && rm -rf aws-sam-cli-$SAM_CLI_VERSION
ENV PATH=$PATH:/usr/local/opt/sam-cli/bin
# Wheel is required by SAM CLI to build libraries like cryptography. It needs to be installed in the system
# Python for it to be picked up during `sam build`
RUN pip3 install wheel
ENV LANG=en_US.UTF-8
ENV PATH=/var/lang/bin:$PATH