sponge
Soak up the input before writing the output file. More information: <https://manned.org/sponge>.
RUN apt-get update && \
apt-get install -y moreutils
RUN apt-get update && \
apt-get install -y moreutils
RUN pacman -S --noconfirm moreutils
RUN apt-get update && \
apt-get install -y moreutils
RUN dnf install -y moreutils
RUN apt-get update && \
apt-get install -y moreutils