-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_NonGUI
More file actions
44 lines (38 loc) · 1.32 KB
/
Dockerfile_NonGUI
File metadata and controls
44 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use the latest Ubuntu base image
FROM ubuntu:latest
# Disable interactive prompts during apt operations
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools, SSL certificates, and libraries needed for Python compilation
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository universe
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
wget \
ca-certificates \
zlib1g-dev \
libncurses5-dev \
libgdbm-dev \
libnss3-dev \
libssl-dev \
libreadline-dev \
libffi-dev \
libsqlite3-dev \
libbz2-dev \
liblzma-dev \
tk-dev \
&& rm -rf /var/lib/apt/lists/*
# Download, compile, and install Python 3.11.10 from source
RUN wget https://www.python.org/ftp/python/3.11.10/Python-3.11.10.tgz \
&& tar -xzf Python-3.11.10.tgz \
&& cd Python-3.11.10 \
&& ./configure --enable-optimizations \
&& make -j"$(nproc)" \
&& make altinstall \
&& cd .. \
&& rm -rf Python-3.11.10 Python-3.11.10.tgz
# Copy docker_nongui_requirements.txt and install Python packages
COPY docker_nongui_requirements.txt .
RUN python3.11 -m pip install --upgrade pip \
&& python3.11 -m pip install -r docker_nongui_requirements.txt