Skip to content

Commit 3b5260d

Browse files
authored
build: use lambda image to ensure binary compatibility when building from source (#650)
* build: use lambda python image instead of debian * use sam build-python images
1 parent db67384 commit 3b5260d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ ARG runtime
77
RUN mkdir -p /build/python/lib/$runtime/site-packages
88
WORKDIR /build
99

10+
# Install newer version of GCC on AL2
11+
RUN set -eux; \
12+
if command -v yum >/dev/null 2>&1; then \
13+
yum -y install git gcc10 gcc10-c++; \
14+
cd /usr/bin; \
15+
rm gcc && ln -s gcc10-gcc gcc; \
16+
rm g++ && ln -s gcc10-g++ g++; \
17+
rm cc && ln -s gcc10-cc cc; \
18+
fi
19+
1020
# Add Rust compiler which is needed to build dd-trace-py from source
1121
RUN curl https://sh.rustup.rs -sSf | \
1222
sh -s -- --default-toolchain stable -y

scripts/build_layers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function docker_build_zip {
6161
# between different python runtimes.
6262
temp_dir=$(mktemp -d)
6363
docker buildx build -t datadog-lambda-python-${arch}:$1 . --no-cache \
64-
--build-arg image=public.ecr.aws/docker/library/python:$1 \
64+
--build-arg image=public.ecr.aws/sam/build-python$1:1 \
6565
--build-arg runtime=python$1 \
6666
--platform linux/${arch} \
6767
--progress=plain \

0 commit comments

Comments
 (0)