Skip to content

Commit fa3055f

Browse files
smaller docker image (#23469)
* save 2gb * not used * more cleanup * little more * wget too big * follow * needed for sim
1 parent 1a54d7f commit fa3055f

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

Dockerfile.openpilot_base

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ ENV LANGUAGE en_US:en
1313
ENV LC_ALL en_US.UTF-8
1414

1515
ENV PIPENV_SYSTEM=1
16+
ENV PYENV_VERSION=3.8.10
17+
ENV PYENV_ROOT="/root/.pyenv"
18+
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
19+
1620
COPY Pipfile Pipfile.lock .python-version update_requirements.sh /tmp/
1721
COPY tools/ubuntu_setup.sh /tmp/tools/
1822
RUN cd /tmp && \
1923
tools/ubuntu_setup.sh && \
20-
rm -rf /tmp/* && \
2124
rm -rf /var/lib/apt/lists/* && \
22-
pip uninstall -y pipenv
25+
rm -rf /tmp/* && \
26+
rm -rf /root/.cache && \
27+
pip uninstall -y pipenv && \
2328

24-
ENV PYENV_VERSION=3.8.10
25-
ENV PYENV_ROOT="/root/.pyenv"
26-
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
29+
# remove unused architectures from gcc for panda
30+
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
31+
rm -rf arm/ && \
32+
rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp

tools/sim/Dockerfile.sim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN pip install --upgrade pip && \
4242

4343
# get same tmux config used on NEOS for debugging
4444
RUN cd $HOME && \
45-
wget https://raw.githubusercontent.com/commaai/eon-neos-builder/master/devices/eon/home/.tmux.conf
45+
curl -O https://raw.githubusercontent.com/commaai/eon-neos-builder/master/devices/eon/home/.tmux.conf
4646

4747
ENV PYTHONPATH $HOME/openpilot:${PYTHONPATH}
4848
RUN mkdir -p $HOME/openpilot

tools/ubuntu_setup.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ function install_ubuntu_common_requirements() {
1313
sudo apt-get install -y --no-install-recommends \
1414
autoconf \
1515
build-essential \
16+
ca-certificates \
1617
clang \
1718
cmake \
1819
make \
1920
cppcheck \
2021
libtool \
21-
libstdc++-arm-none-eabi-newlib \
2222
gcc-arm-none-eabi \
2323
bzip2 \
2424
liblzma-dev \
@@ -28,7 +28,6 @@ function install_ubuntu_common_requirements() {
2828
libcapnp-dev \
2929
curl \
3030
libcurl4-openssl-dev \
31-
wget \
3231
git \
3332
git-lfs \
3433
ffmpeg \
@@ -50,24 +49,15 @@ function install_ubuntu_common_requirements() {
5049
libsqlite3-dev \
5150
libusb-1.0-0-dev \
5251
libzmq3-dev \
53-
libsdl1.2-dev \
54-
libsdl-image1.2-dev \
55-
libsdl-mixer1.2-dev \
56-
libsdl-ttf2.0-dev \
57-
libsmpeg-dev \
58-
libportmidi-dev \
59-
libfreetype6-dev \
6052
libsystemd-dev \
6153
locales \
6254
opencl-headers \
6355
ocl-icd-libopencl1 \
6456
ocl-icd-opencl-dev \
6557
clinfo \
6658
python-dev \
67-
python3-pip \
6859
qml-module-qtquick2 \
6960
qtmultimedia5-dev \
70-
qtwebengine5-dev \
7161
qtlocation5-dev \
7262
qtpositioning5-dev \
7363
libqt5sql5-sqlite \

tools/webcam/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2727
mkdir /tmp/opencv_build && \
2828
cd /tmp/opencv_build && \
2929

30-
wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz && \
30+
curl -L -O https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz && \
3131
tar -xvf ${OPENCV_VERSION}.tar.gz && \
3232
mv opencv-${OPENCV_VERSION} OpenCV && \
3333
cd OpenCV && mkdir build && cd build && \
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3737
make install && \
3838
ldconfig && \
3939

40-
cd /tmp && rm -rf /tmp/opencv_build
40+
cd / && rm -rf /tmp/*

0 commit comments

Comments
 (0)