@@ -98,7 +98,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
9898 x11-apps \
9999 && apt-get -y autoremove \
100100 && apt-get clean autoclean \
101- && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
101+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
102102
103103RUN curl -L -o xorg.conf https://xpra.org/xorg.conf || echo "Download failed" \
104104 && rm -rf /tmp/*
@@ -115,7 +115,8 @@ RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y \
115115 libxv1:i386 \
116116 libglu1-mesa:i386 \
117117 libegl1-mesa:i386 \
118- libegl1-mesa:amd64
118+ libegl1-mesa:amd64 \
119+ && rm -rf /var/lib/apt/lists/*
119120
120121RUN apt-get update && dpkg -i /virtualgl_${VIRTUALGL_VERSION}_amd64.deb /virtualgl32_${VIRTUALGL_VERSION}_amd64.deb \
121122 && rm /virtualgl_${VIRTUALGL_VERSION}_amd64.deb /virtualgl32_${VIRTUALGL_VERSION}_amd64.deb \
@@ -147,25 +148,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
147148# Node
148149RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \
149150 && apt-get install -y nodejs \
150- && npm install -g yarn
151+ && npm install -g yarn \
152+ && rm -rf /var/lib/apt/lists/*
151153
152154# Install Python 3 pip build dependencies first
153- RUN python3.10 -m pip install --upgrade pip==23.3.1 wheel==0.41.3 setuptools==69.0.2 selenium
155+ RUN python3.10 -m pip install --no-cache-dir -- upgrade pip==23.3.1 wheel==0.41.3 setuptools==69.0.2 selenium
154156
155157# pip install dependencies
156- RUN python3.10 -m pip install \
158+ RUN python3.10 -m pip install --no-cache-dir \
157159 pylint==3.3.1 transitions==0.9.0 pydantic==2.4.2 websocket-client==1.5.2 \
158160 argparse==1.4.0 coverage==6.2 cerberus==1.3.4 empy==3.3.4 jinja2==3.0.3 kconfiglib==14.1.0 \
159161 matplotlib==3.0.* numpy==1.24.3 nunavut==1.1.0 packaging==21.3 pkgconfig==1.5.5 pyros-genmsg==0.5.8 \
160162 pyulog==1.0.1 pyyaml==5.4.1 requests==2.31.0 serial==0.0.97 six==1.16.0 toml==0.10.2 psutil==5.9.0 \
161- onnxruntime-gpu==1.22.0 Pillow==9.0.1 opencv-python==4.5.5.64 netron seaborn==0.11.2 watchdog==2.1.5 utm==0.7.0 psycopg2 jedi pyapriltags
163+ onnxruntime-gpu==1.22.0 Pillow==9.0.1 opencv-python==4.5.5.64 watchdog==2.1.5 utm==0.7.0 psycopg2 jedi pyapriltags
162164
163165# install pytorch with CUDA 12.8 support
164- RUN python3.10 -m pip install --ignore-installed sympy==1.13.3
165- RUN python3.10 -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu128
166+ RUN python3.10 -m pip install --no-cache-dir -- ignore-installed sympy==1.13.3
167+ RUN python3.10 -m pip install --no-cache-dir torch --extra-index-url https://download.pytorch.org/whl/cu128
166168
167169# monaco editor
168- RUN python3.10 -m pip install black==24.10.0
170+ RUN python3.10 -m pip install --no-cache-dir black==24.10.0
169171
170172# Install ONNX Runtime C++ API
171173RUN apt-get update && apt-get install -y wget && \
@@ -174,19 +176,21 @@ RUN apt-get update && apt-get install -y wget && \
174176 cp -r /tmp/onnxruntime-linux-x64-1.17.1/include/* /usr/local/include/ && \
175177 cp -r /tmp/onnxruntime-linux-x64-1.17.1/lib/* /usr/local/lib/ && \
176178 ldconfig && \
177- rm -rf /tmp/onnxruntime*
179+ rm -rf /tmp/onnxruntime* && \
180+ rm -rf /var/lib/apt/lists/*
178181
179182# websocket server dependency
180- RUN python3.10 -m pip install websocket_server==0.6.4 posix-ipc==1.1.1 django==4.1.7 djangorestframework==3.13.1 \
183+ RUN python3.10 -m pip install --no-cache-dir websocket_server==0.6.4 posix-ipc==1.1.1 django==4.1.7 djangorestframework==3.13.1 \
181184 django-webpack-loader==1.5.0 django-cors-headers==3.14.0 websockets==11.0.3 asyncio==3.4.3
182185
183186# BT STUDIO hotfix
184- RUN python3.10 -m pip install py-trees autopep8
187+ RUN python3.10 -m pip install --no-cache-dir py-trees autopep8
185188RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
186189 && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \
187190 && apt-get update && apt-get install -y \
188191 ros-humble-py-trees \
189- ros-humble-py-trees-ros
192+ ros-humble-py-trees-ros \
193+ && rm -rf /var/lib/apt/lists/*
190194
191195## Aerostack2
192196WORKDIR /root/
@@ -216,7 +220,7 @@ RUN apt-get update && \
216220 gnupg \
217221 && rm -rf /var/lib/apt/lists/*
218222
219- RUN pip3 install \
223+ RUN pip3 install --no-cache-dir \
220224 pylint \
221225 flake8==4.0.1 \
222226 pycodestyle==2.8 \
0 commit comments