forked from REG-Linux/REG-Linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (67 loc) · 1.66 KB
/
Dockerfile
File metadata and controls
73 lines (67 loc) · 1.66 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM ubuntu:24.04
# Disable interactive prompts during build
ARG DEBIAN_FRONTEND=noninteractive
# --- System update and basic setup ---
# Update package lists and install essential build tools and utilities.
RUN apt-get -o APT::Retries=3 update -y && \
apt-get -o APT::Retries=3 install -y --no-install-recommends \
bash \
bc \
binutils \
build-essential \
bzip2 \
bzr \
ca-certificates \
cmake \
cpio \
curl \
cvs \
diffutils \
file \
findutils \
gawk \
g++ \
g++-multilib \
gcc \
gcc-multilib \
git \
graphviz \
gzip \
libgnutls28-dev \
libncurses-dev \
libssl-dev \
locales \
make \
patch \
perl \
python3-matplotlib \
rsync \
sed \
tar \
unzip \
wget \
which && \
# Remove unnecessary packages to minimize image size
apt-get remove -y '*cloud*' '*firefox*' '*chrome*' '*dotnet*' '*php*' && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
# --- Locale configuration ---
# Enable the UTF-8 locale for proper encoding support during builds.
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV TZ=Europe/Paris
# --- Create non-root build user ---
# Improves security by avoiding root operations during compilation.
RUN useradd -m -s /bin/bash build && \
mkdir -p /build && \
chown build:build /build
# Set the working directory and switch to the build user
WORKDIR /build
USER build
# --- Default command ---
# Start a Bash shell when the container runs.
CMD ["/bin/bash"]