Closed ruffsl closed 4 years ago
Out of curiosity, here is the diff between ubuntu:bionic
vs the 651MB version above
Some packages that sort of stood out to me though:
Plus all the dev images, but that's being tracked elsewhere: https://discourse.ros.org/t/generating-dev-and-runtime-artefacts-from-ros-packages/12448/23
default-libmysqlclient-dev/now 1.0.4 amd64 [installed,local]
dpkg-dev/now 1.19.0.5ubuntu2.3 all [installed,local]
libc6-dev/now 2.27-3ubuntu1 amd64 [installed,local]
libconsole-bridge-dev/now 0.4.0+dfsg-2 amd64 [installed,local]
libexpat1-dev/now 2.2.5-3ubuntu0.2 amd64 [installed,local]
libgtest-dev/now 1.8.0-6 amd64 [installed,local]
libmysqlclient-dev/now 5.7.29-0ubuntu0.18.04.1 amd64 [installed,local]
libpcre3-dev/now 2:8.39-9 amd64 [installed,local]
libpoco-dev/now 1.8.0.1-1ubuntu4 amd64 [installed,local]
libpython3-dev/now 3.6.7-1~18.04 amd64 [installed,local]
libpython3.6-dev/now 3.6.9-1~18.04 amd64 [installed,local]
libsqlite3-dev/now 3.22.0-1ubuntu0.2 amd64 [installed,local]
libssl-dev/now 1.1.1-1ubuntu2.1~18.04.5 amd64 [installed,local]
libtinyxml2-dev/now 6.0.0+dfsg-1 amd64 [installed,local]
libyaml-dev/now 0.1.7-2ubuntu3 amd64 [installed,local]
linux-libc-dev/now 4.15.0-76.86 amd64 [installed,local]
python3-dev/now 3.6.7-1~18.04 amd64 [installed,local]
python3.6-dev/now 3.6.9-1~18.04 amd64 [installed,local]
zlib1g-dev/now 1:1.2.11.dfsg-0ubuntu2 amd64 [installed,local]
Great initiative, all for more concise images :+1:
Your example is based on ROS 2 images, is the idea that this will apply to ROS 1 images as well or only ROS 2 ? Another related topic is a more "minimal" variant than ros-core being discussed at https://github.com/ros-infrastructure/rep/pull/231
I believe we are mixing a couple different things here only one of them having to do with the bootstrapping tools:
Ideally we would look at the difference in size of the last bullet only in this PR to evaluate the benefit of moving the tooling (based on your data above it would be around 5-6%).
One concern I have with this is that anyone having a CI system using ros-core as a base image and installing dependencies + building things on top will be broken. I don't know how many CI systems still use the ros-core image as a base given it's often outdated so maybe it won't impact that many systems.
Some packages that sort of stood out to me though
Yeah these also fall under the "dev" packages category and we should find a way to not have them by default if the building tools are not includes :+1:
Some like python3-catkin-pkg-modules
surprise me less as I wouldnt be surpised if ros2 command line tools need to be able to parse package.xml
RE:
The installation of runtime packages from pip (needs to be investigated, maybe the ubuntu version is now recent enough to be used)
I opened https://github.com/osrf/docker_images/pull/377 to oremove the unnecessary install of argcomplete and pip.
in the end the change suggested here has been integrated to https://github.com/osrf/docker_images/pull/357
I was thinking one thing we could do to further optimize the image size of
ros-core
tags, the tag intended as a minimal bare bones ros install or preferable for runtime stages in multistage builds, could be to migrate all of the dev tooling up into theros-base
tag images, that is intended as the go-to or de factolatest
tag for average users.I played around with the
ros-core
Dockerfile, by either just adding--no-install-recommends
to all apt installs, omitting build bootstrap tooling, or doing both as once, e.g:Size breakdown, with minimal bootstrap + no-install-recommends giving 21% size reduction:
Additionally, here is a diff of the packages removed in the minimal 651MB version:
And the original list of packages for reference: