FROM public.ecr.aws/lambda/java:8 RUN yum groupinstall -y development && \ yum install -d1 -y \ tar \ gzip \ unzip \ python38 \ jq \ grep \ curl \ make \ rsync \ gcc-c++ \ binutils \ procps \ libgmp3-dev \ zlib1g-dev \ liblzma-dev \ libxslt-devel \ libmpc-devel \ java-1.8.0-openjdk-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 -rf awscliv2.zip && rm -rf ./aws # Install SAM CLI via native linux installer ARG SAM_CLI_VERSION RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v$SAM_CLI_VERSION/aws-sam-cli-linux-x86_64.zip" -o "samcli.zip" && \ unzip samcli.zip -d sam-installation && ./sam-installation/install && \ rm samcli.zip && rm -rf sam-installation && sam --version # Prepare virtualenv for lambda builders RUN python3 -m venv --without-pip /usr/local/opt/lambda-builders RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py RUN /usr/local/opt/lambda-builders/bin/python3 get-pip.py # Install lambda builders in a dedicated Python virtualenv RUN AWS_LB_VERSION=$(curl -sSL https://raw.githubusercontent.com/aws/aws-sam-cli/v$SAM_CLI_VERSION/requirements/base.txt | grep aws_lambda_builders | cut -d= -f3) && \ /usr/local/opt/lambda-builders/bin/pip3 --no-cache-dir install "aws-lambda-builders==$AWS_LB_VERSION" ENV PATH=$PATH:/usr/local/opt/lambda-builders/bin ENV LANG=en_US.UTF-8 # 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 # Install Java buld tools RUN mkdir /usr/local/gradle && curl -L -o gradle.zip https://downloads.gradle.org/distributions/gradle-6.2.2-bin.zip && \ unzip -d /usr/local/gradle gradle.zip && rm gradle.zip && mkdir /usr/local/maven && \ curl -L https://downloads.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz | \ tar -zx -C /usr/local/maven ENV PATH="/usr/local/gradle/gradle-6.2.2/bin:/usr/local/maven/apache-maven-3.8.8/bin:${PATH}" ENV JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" COPY ATTRIBUTION.txt / # Compatible with initial base image ENTRYPOINT [] CMD ["/bin/bash"]