Skip to content

Commit a6eb4c0

Browse files
build: Upgrade python version for docker image build (#814)
* build(deps): bump the pip group across 2 directories with 2 updates Bumps the pip group with 2 updates in the / directory: [filelock](https://github.com/tox-dev/py-filelock) and [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions). Bumps the pip group with 1 update in the /doc directory: [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions). Updates `filelock` from 3.19.1 to 3.20.1 - [Release notes](https://github.com/tox-dev/py-filelock/releases) - [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst) - [Commits](tox-dev/filelock@3.19.1...3.20.1) Updates `pymdown-extensions` from 10.14.3 to 10.16.1 - [Release notes](https://github.com/facelessuser/pymdown-extensions/releases) - [Commits](facelessuser/pymdown-extensions@10.14.3...10.16.1) Updates `pymdown-extensions` from 10.14.3 to 10.16.1 - [Release notes](https://github.com/facelessuser/pymdown-extensions/releases) - [Commits](facelessuser/pymdown-extensions@10.14.3...10.16.1) --- updated-dependencies: - dependency-name: filelock dependency-version: 3.20.1 dependency-type: direct:production dependency-group: pip - dependency-name: pymdown-extensions dependency-version: 10.16.1 dependency-type: direct:production dependency-group: pip - dependency-name: pymdown-extensions dependency-version: 10.16.1 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com> * build: upgrade Python to 3.13 in Dockerfile Signed-off-by: Tetiana Naumenko <t.naumenko@samsung.com> * build: change solution to use Python from source Signed-off-by: Tetiana Naumenko <t.naumenko@samsung.com> * chore: restrore changes from dependabot Signed-off-by: Tetiana Naumenko <t.naumenko@samsung.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Tetiana Naumenko <t.naumenko@samsung.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent e4f3a2e commit a6eb4c0

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

Dockerfile

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,68 @@ COPY . .
1313
# Build LPVS-open-source application
1414
RUN mvn clean install
1515

16-
# Base image for running lpvs container
16+
# OpenJDK 17 stage
1717
FROM openjdk:17-slim@sha256:aaa3b3cb27e3e520b8f116863d0580c438ed55ecfa0bc126b41f68c3f62f9774
1818

19-
# Install dependencies and remove tmp files
19+
# Install build dependencies for Python compilation
2020
RUN apt-get update && \
2121
apt-get upgrade -y && \
22-
apt-get install -y python3-pip && \
22+
apt-get install -y \
23+
ca-certificates \
24+
wget \
25+
build-essential \
26+
libssl-dev \
27+
zlib1g-dev \
28+
libncurses5-dev \
29+
libncursesw5-dev \
30+
libreadline-dev \
31+
libsqlite3-dev \
32+
libgdbm-dev \
33+
libdb5.3-dev \
34+
libbz2-dev \
35+
libexpat1-dev \
36+
libffi-dev \
37+
liblzma-dev \
38+
uuid-dev && \
2339
apt-get clean
40+
41+
# Download and compile Python 3.13 from source with optimizations
42+
RUN --mount=type=cache,target=/var/cache/apt \
43+
--mount=type=cache,target=/root/.cache/pip \
44+
wget https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz && \
45+
tar xzf Python-3.13.1.tgz && \
46+
cd Python-3.13.1 && \
47+
./configure \
48+
--enable-optimizations \
49+
--enable-shared \
50+
--with-ensurepip=install \
51+
--prefix=/usr/local \
52+
--disable-test-modules \
53+
--disable-tk \
54+
--disable-curses \
55+
LDFLAGS="-Wl,-rpath,/usr/local/lib" && \
56+
make -j$(nproc) PROFILE_TASK="" && \
57+
make altinstall && \
58+
cd .. && \
59+
rm -rf Python-3.13.1 Python-3.13.1.tgz
60+
61+
# Create symlinks for easier access
62+
RUN ln -sf /usr/local/bin/python3.13 /usr/bin/python3.13 && \
63+
ln -sf /usr/local/bin/pip3.13 /usr/bin/pip3.13 && \
64+
ln -sf /usr/local/bin/python3.13 /usr/bin/python3 && \
65+
ln -sf /usr/local/bin/pip3.13 /usr/bin/pip3
66+
67+
# Update shared library cache
68+
RUN ldconfig
69+
70+
# Clean up apt caches and tmp files
2471
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2572

2673
WORKDIR /root/
2774

2875
# Install SCANOSS
2976
COPY --from=builder /root/requirements.txt ./
30-
RUN pip3 install --require-hashes -r requirements.txt
77+
RUN python3.13 -m pip install --require-hashes -r requirements.txt
3178

3279
# Allow to listen port 7896
3380
EXPOSE 7896

0 commit comments

Comments
 (0)