In order to reduce complexity, dependencies, file sizes, and build times, you should avoid installing extra or unnecessary packages just because they might be “nice to have”. For example, you don’t need to include a text editor in a database image. Use the –no-install-recommends option.
Remove the package manager cache: rm -rf /var/lib/apt/lists/*