There is more than one way to install package with apt/apt-get. I think the following code should not trigger the update_require_install rule, even if it's a different kind of "install" (source package or build dependencies packages):
RUN apt-get update \
&& apt-get build-dep --assume-yes --no-install-recommends libonig \
&& apt-get source libonig=6.9.8-1
&& cd libonig-6.9.8 \
&& dpkg-buildpackage -us -uc -nc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Current status:
Line 2: RUN apt-get update \
Issue Category Title Description
1 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install`
without matching commands on the same line to reduce image size.
apt-get install