Skip to content

Commit 50bd53e

Browse files
author
Alexander Smirnov
committed
Fix ubuntu tests
1 parent e8fb730 commit 50bd53e

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

tests/integration/docker/Dockerfile.echo.ubuntu

+16-21
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ ARG RUNTIME_VERSION
1212
RUN apt-get update && apt-get install -y software-properties-common
1313
RUN add-apt-repository ppa:deadsnakes/ppa
1414
RUN apt-get update && \
15-
apt-get install -y curl python${RUNTIME_VERSION}
16-
17-
RUN ln -s /usr/bin/python${RUNTIME_VERSION} /usr/local/bin/python3
18-
15+
apt-get install -y \
16+
curl \
17+
python${RUNTIME_VERSION} \
18+
python3-pip \
19+
python3-virtualenv
20+
21+
# python3xx-distutils is needed for python < 3.12
22+
RUN if [ $(echo ${RUNTIME_VERSION} | cut -d '.' -f 2) -lt 12 ]; then \
23+
apt-get install -y python${RUNTIME_VERSION}-distutils; \
24+
fi
25+
RUN virtualenv --python /usr/bin/python${RUNTIME_VERSION} --no-setuptools /home/venv
1926

2027

2128

@@ -25,8 +32,7 @@ FROM python-image AS python-ubuntu-builder
2532
ARG RUNTIME_VERSION
2633

2734
# Install aws-lambda-cpp build dependencies
28-
RUN apt-get update && \
29-
apt-get install -y \
35+
RUN apt-get install -y \
3036
g++ \
3137
gcc \
3238
tar \
@@ -39,16 +45,6 @@ RUN apt-get update && \
3945
libcurl4-openssl-dev \
4046
python${RUNTIME_VERSION}-dev
4147

42-
RUN if [ $(echo "${RUNTIME_VERSION}" | cut -d '.' -f 2) -ge 12 ]; then \
43-
apt-get install -y python3-setuptools python3-pip python${RUNTIME_VERSION}-venv && \
44-
python3 -m venv /home/venv; \
45-
else \
46-
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && \
47-
python${RUNTIME_VERSION} get-pip.py && \
48-
pip3 install virtualenv && \
49-
virtualenv /home/venv; \
50-
fi
51-
5248
# Include global args in this stage of the build
5349
ARG RIC_BUILD_DIR="/home/build/"
5450
# Create function directory
@@ -61,19 +57,18 @@ RUN . /home/venv/bin/activate && \
6157
make init build test && \
6258
mv ./dist/awslambdaric-*.tar.gz ./dist/awslambdaric-test.tar.gz
6359

60+
61+
6462
# Include global args in this stage of the build
6563
ARG FUNCTION_DIR="/home/app/"
6664
# Create function directory
6765
RUN mkdir -p ${FUNCTION_DIR}
6866
# Copy function code
6967
COPY tests/integration/test-handlers/echo/* ${FUNCTION_DIR}
70-
# Copy Runtime Interface Client .tgz
71-
RUN cp ./dist/awslambdaric-test.tar.gz ${FUNCTION_DIR}/awslambdaric-test.tar.gz
72-
7368
# Install the function's dependencies
7469
WORKDIR ${FUNCTION_DIR}
75-
RUN python${RUNTIME_VERSION} -m pip install awslambdaric-test.tar.gz --target ${FUNCTION_DIR} && \
76-
rm awslambdaric-test.tar.gz
70+
RUN . /home/venv/bin/activate && \
71+
pip install ${RIC_BUILD_DIR}/dist/awslambdaric-test.tar.gz --target ${FUNCTION_DIR}
7772

7873

7974

0 commit comments

Comments
 (0)