no install recommends for all apt calls#82
Conversation
b8106da to
ba6cced
Compare
|
|
||
| # install requested metapackage | ||
| RUN apt-get update && apt-get install -q -y @(' '.join(packages))@ | ||
| RUN apt-get update && apt-get install -q -y --no-install-recommends @(' '.join(packages))@ |
There was a problem hiding this comment.
Was this template always missing the && rm -rf /var/lib/apt/lists/*? Where is this template used again?
There was a problem hiding this comment.
It's not used anywhere in docker_images or docker_templates at the moment. But I don't know what it was used for before
|
Could we compare the delta of package installed? I'd only like to skim over what this would remove, just to be sure there isn't anything we were implicitly relying on, or should explicitly install instead. |
|
I don't have a list for the various images For example for osrf/ros:melodic-desktop-full-bionic |
ba6cced to
58792f4
Compare
|
@ruffsl I remember we chatted about this offline a couple days ago. Do you remember what the next step is ? All I remember was mentioning the fact that in ROS 1 build-essentials is not installed by default and just mentioned in the installation instructions for people who want to build packages Do you remember anything else? |
I think we wanted to smoke test this change by building some of the existing Dockerfiles in the wild, like the Navigation2 or MoveIt2 repos, to see what else might be removed that was for granted prior. |
oh right ! Based on previous comment: the docker image will not include build-essential anymore, so it will not include a C++ compiler, these images building code will need to now install e.g. build-essential or gcc to be able to build packages. Which bring us back to the question: in which image (if any) should the building tools be provided: osrf/docker_images#375 ? |
|
I think it makes sense to install build essentials in the base tag, otherwise there's little differentiation both in size and in included features between the core and base tags. Perhaps we should roll these pull requests into one, so that we can jointly test the minimal install footprint needed to retain convenient compilation features in the base tag. E.g. does build essentials include CMake? |
|
Yeah that would make sense.
That is true especially since https://github.com/ros/metapackages/pull/24/files My only concern is how do you carry the information to users. One issue with the mapping to metapackages is that as a user I assume that ros_base provides me just But to be fair documentation should be enough, people can never infer exactly what features/packages are included in a given image.
no, but cmake is a dependency of many packages even in the core so it'll always be there.
Fair enough I'll push a version with build-essentials that we can use for testing |
The base tag is also pointed to by the unqualified distro tag, making it more default like, so I think it gets some exceptional status.
Other todo then to update in the readme and library doc PR when we merge. |
Yeah that's fair Pushed a version installing The good news is that both moveit ROS 1, moveit 2 ROS 2 and navigation2 ROS 2 built successfully. The not-as-good news is that we didnt save any space in the ros_base image
|
Ooph... That curbs my enthusiasm. Perhaps its only worth it to apply all of this to just the |
|
It does still save space on core and downstream images. it's just that the space saved in core/base was mostly due to
This option only applies to the command beng currently ran. It just says to install only the hard dependencies and not the recommended or suggested ones (suggested ignored by default). If users An example of this is rosdep install. There is no way ATM to specify |
|
I think I was asking: are recommended dependencies recursively installed for dependencies already installed, or only installs the recommended dependencies declared in the packages to be installed. I'm guessing the later is the case, as |
👍 the latter is the case. But it's not granular, it just removes all packages that were installed as "Recommended" |
|
This and osrf/docker_images#357 have been updated to install the ros tools and build-essential in ros-base. I confirmed that the following images build successfully on top:
Package diffferences between ros-base and ros-base-no-recomments EloquentMelodicReady for review |
Not sure we'd want to do it, but cat > /etc/apt/apt.conf.d/01_disable_recommends_suggests << EOF
APT::Install-Recommends "0";
APT::Install-Suggests "0";
EOFThat would remove the need to pass it via |
|
That's a good point 👍 thanks for pointing it out. I agree that it may not be appropriate to set it in the images and let the consumers of the images decide. Currently no official image uses rosdep to install packages (except We could highlight both approaches (configure APT and remove already installed recommended packages) in the docs. |
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
33288d8 to
136c03a
Compare
https://discourse.ros.org/t/generating-dev-and-runtime-artefacts-from-ros-packages/12448 reminded me of an old branch adding the use of
no-install-recommends. While not providing significant improvement it would still reduce image size by about 10%.This is what is used elsewhere, e.g. for ROS 2 CI
Ideally we would be able to pass something similar to rosdep and reduce the nightly image size. If we could also tell rosdep to install only the
execandbuild_exportdepends we could reduce the image size furtherOne thing unexpected and maybe worth further investigation is how is eloquent-desktop so much bigger than melodic-desktop while desktop includes a lot less features in ROS 2 than ROS 1