diff --git a/Dockerfile b/Dockerfile index 77125129..ee4c7efd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,16 @@ ARG runtime RUN mkdir -p /build/python/lib/$runtime/site-packages WORKDIR /build +# Install newer version of GCC on AL2 +RUN set -eux; \ + if command -v yum >/dev/null 2>&1; then \ + yum -y install git gcc10 gcc10-c++; \ + cd /usr/bin; \ + rm gcc && ln -s gcc10-gcc gcc; \ + rm g++ && ln -s gcc10-g++ g++; \ + rm cc && ln -s gcc10-cc cc; \ + fi + # Add Rust compiler which is needed to build dd-trace-py from source RUN curl https://sh.rustup.rs -sSf | \ sh -s -- --default-toolchain stable -y diff --git a/scripts/build_layers.sh b/scripts/build_layers.sh index a0d6ee39..23941b7a 100755 --- a/scripts/build_layers.sh +++ b/scripts/build_layers.sh @@ -61,7 +61,7 @@ function docker_build_zip { # between different python runtimes. temp_dir=$(mktemp -d) docker buildx build -t datadog-lambda-python-${arch}:$1 . --no-cache \ - --build-arg image=public.ecr.aws/docker/library/python:$1 \ + --build-arg image=public.ecr.aws/sam/build-python$1:1 \ --build-arg runtime=python$1 \ --platform linux/${arch} \ --progress=plain \