File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 11#ddev-generated
2- # Adapted from https://web.archive.org/web/20250223192706/https://www.fadedbee.com/2024/01/18/installing-python2-on-debian-12-bookworm/
2+ COPY --from=python:2.7-slim /usr/local /usr/local
3+ COPY --from=python:2.7-slim /usr/lib/ /tmp/python2-libs/
34ARG TARGETARCH
4- RUN mkdir -p /tmp/python2 && \
5- wget -O /tmp/python2/python2.7.tar.gz https://github.com/stasadev/ddev-python2/releases/download/v1.0.1/python2.7_${TARGETARCH}.tar.gz && \
6- tar -xzf /tmp/python2/python2.7.tar.gz -C /tmp/python2 && \
7- source /etc/os-release && \
8- if [ "$VERSION_CODENAME" = "bookworm" ]; then rm -f /tmp/python2/libnsl2*.deb /tmp/python2/libtirpc3t64*.deb; fi && \
9- dpkg -i /tmp/python2/*.deb && \
10- rm -rf /tmp/python2 && \
11- ln -s /usr/bin/python2.7 /usr/local/bin/python
5+ RUN if [ "$TARGETARCH" = "amd64" ]; then \
6+ LIB_ARCH="x86_64-linux-gnu"; \
7+ elif [ "$TARGETARCH" = "arm64" ]; then \
8+ LIB_ARCH="aarch64-linux-gnu"; \
9+ else \
10+ echo "Unsupported architecture: $TARGETARCH"; exit 1; \
11+ fi && \
12+ echo "Detected architecture: $TARGETARCH ($LIB_ARCH)" && \
13+ mkdir -p /usr/lib/$LIB_ARCH && \
14+ cp /tmp/python2-libs/*/libssl.so.1.1 /usr/lib/$LIB_ARCH/ && \
15+ cp /tmp/python2-libs/*/libcrypto.so.1.1 /usr/lib/$LIB_ARCH/ && \
16+ rm -rf /tmp/python2-libs && \
17+ ldconfig
You can’t perform that action at this time.
0 commit comments