RUN During Image Build
RUN executes commands while the image is being built. Package installation should happen during the build rather than every time the container starts.
For Debian/Ubuntu based images, clean package lists after installation. For language ecosystems, use their lockfile-aware installation command such as npm ci, pip with a locked requirements set, or a package manager's frozen-lockfile mode.