-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathDockerfile.base
More file actions
144 lines (127 loc) · 3.01 KB
/
Dockerfile.base
File metadata and controls
144 lines (127 loc) · 3.01 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Base Image (ci-base)
FROM ubuntu:24.04
ARG USERNAME=user
ARG UID=1000
ARG GID=1000
ARG PYTHON_VENV_PATH=/opt/python/venv
# this conflicts with uid 1000, remove it
RUN userdel -r ubuntu || true
# Set default shell during Docker image build to bash
SHELL ["/bin/bash", "-c"]
# Set non-interactive frontend for apt-get to skip any user confirmations
ENV DEBIAN_FRONTEND=noninteractive
# Install base packages
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install --no-install-recommends -y \
software-properties-common \
lsb-release \
autoconf \
automake \
bison \
build-essential \
ca-certificates \
ccache \
chrpath \
cmake \
cpio \
device-tree-compiler \
dfu-util \
diffstat \
dos2unix \
doxygen \
file \
flex \
g++ \
gawk \
gcc \
gcovr \
gdb \
git \
git-core \
gnupg \
gperf \
help2man \
iproute2 \
lcov \
libcairo2-dev \
libglib2.0-dev \
libgtk2.0-0 \
liblocale-gettext-perl \
libncurses5-dev \
libpcap-dev \
libpopt0 \
libsdl1.2-dev \
libsdl2-dev \
libssl-dev \
libtool \
libtool-bin \
locales \
make \
net-tools \
ninja-build \
openssh-client \
parallel \
pkg-config \
python3-dev \
python3-pip \
python3-ply \
python3-setuptools \
python-is-python3 \
python3-venv \
rsync \
socat \
srecord \
sudo \
texinfo \
unzip \
valgrind \
wget \
ovmf \
xz-utils \
thrift-compiler
# Install multi-lib gcc (x86 only)
RUN if [ "${HOSTTYPE}" = "x86_64" ]; then \
apt-get install --no-install-recommends -y \
gcc-multilib \
g++-multilib \
; fi
# Install i386 packages (x86 only)
RUN if [ "${HOSTTYPE}" = "x86_64" ]; then \
dpkg --add-architecture i386 && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get install --no-install-recommends -y \
libsdl2-dev:i386 libfuse-dev:i386 libc6-dbg:i386 python3\
; fi
# Initialise system locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN mkdir -p ${PYTHON_VENV_PATH} && \
python3 -m venv ${PYTHON_VENV_PATH}
ENV PATH=${PYTHON_VENV_PATH}/bin:$PATH
RUN cd ${PYTHON_VENV_PATH}/bin && \
pip install --no-cache-dir --upgrade pip setuptools wheel
# Install Python dependencies
RUN pip3 install --no-cache-dir \
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/main/scripts/requirements.txt \
-r https://raw.githubusercontent.com/zephyrproject-rtos/mcuboot/main/scripts/requirements.txt \
GitPython imgtool junitparser junit2html numpy protobuf grpcio-tools PyGithub \
pylint sh statistics west \
nrf-regtool~=9.0.1
# Run pip check on x86 only for now, it fails on arm.
RUN if [ "${HOSTTYPE}" = "x86_64" ]; then \
pip3 check \
; fi
# Clean up stale packages
RUN apt-get clean -y && \
apt-get autoremove --purge -y && \
rm -rf /var/lib/apt/lists/*
# Create 'user' account
RUN groupadd -g $GID -o $USERNAME
RUN useradd -u $UID -m -g $USERNAME -G plugdev $USERNAME \
&& echo $USERNAME ' ALL = NOPASSWD: ALL' > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
USER root