FROM public.ecr.aws/lambda/go:1 RUN yum groupinstall -y development && \ yum install -d1 -y \ tar \ gzip \ unzip \ python38 \ jq \ git \ grep \ curl \ make \ rsync \ gcc-c++ \ binutils \ procps \ libgmp3-dev \ zlib1g-dev \ liblzma-dev \ libxslt-devel \ libmpc-devel \ && yum clean all # Install Go RUN curl -L https://go.dev/dl/go1.20.linux-amd64.tar.gz | tar -zx -C /usr/local ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin # Set GOPROXY envvar to avoid using the default proxy.golang.org proxy ENV GOPROXY=direct # 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 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 COPY ATTRIBUTION.txt / # Compatible with initial base image ENTRYPOINT [] CMD ["/bin/bash"]