Skip to content

Commit

Permalink
smaller docker image (commaai#23469)
Browse files Browse the repository at this point in the history
* save 2gb

* not used

* more cleanup

* little more

* wget too big

* follow

* needed for sim
  • Loading branch information
adeebshihadeh authored Jan 10, 2022
1 parent 1a54d7f commit fa3055f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
16 changes: 11 additions & 5 deletions Dockerfile.openpilot_base
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV PIPENV_SYSTEM=1
ENV PYENV_VERSION=3.8.10
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"

COPY Pipfile Pipfile.lock .python-version update_requirements.sh /tmp/
COPY tools/ubuntu_setup.sh /tmp/tools/
RUN cd /tmp && \
tools/ubuntu_setup.sh && \
rm -rf /tmp/* && \
rm -rf /var/lib/apt/lists/* && \
pip uninstall -y pipenv
rm -rf /tmp/* && \
rm -rf /root/.cache && \
pip uninstall -y pipenv && \

ENV PYENV_VERSION=3.8.10
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
# remove unused architectures from gcc for panda
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
rm -rf arm/ && \
rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
2 changes: 1 addition & 1 deletion tools/sim/Dockerfile.sim
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN pip install --upgrade pip && \

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

ENV PYTHONPATH $HOME/openpilot:${PYTHONPATH}
RUN mkdir -p $HOME/openpilot
Expand Down
12 changes: 1 addition & 11 deletions tools/ubuntu_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function install_ubuntu_common_requirements() {
sudo apt-get install -y --no-install-recommends \
autoconf \
build-essential \
ca-certificates \
clang \
cmake \
make \
cppcheck \
libtool \
libstdc++-arm-none-eabi-newlib \
gcc-arm-none-eabi \
bzip2 \
liblzma-dev \
Expand All @@ -28,7 +28,6 @@ function install_ubuntu_common_requirements() {
libcapnp-dev \
curl \
libcurl4-openssl-dev \
wget \
git \
git-lfs \
ffmpeg \
Expand All @@ -50,24 +49,15 @@ function install_ubuntu_common_requirements() {
libsqlite3-dev \
libusb-1.0-0-dev \
libzmq3-dev \
libsdl1.2-dev \
libsdl-image1.2-dev \
libsdl-mixer1.2-dev \
libsdl-ttf2.0-dev \
libsmpeg-dev \
libportmidi-dev \
libfreetype6-dev \
libsystemd-dev \
locales \
opencl-headers \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
clinfo \
python-dev \
python3-pip \
qml-module-qtquick2 \
qtmultimedia5-dev \
qtwebengine5-dev \
qtlocation5-dev \
qtpositioning5-dev \
libqt5sql5-sqlite \
Expand Down
4 changes: 2 additions & 2 deletions tools/webcam/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
mkdir /tmp/opencv_build && \
cd /tmp/opencv_build && \

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

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

0 comments on commit fa3055f

Please sign in to comment.