It is not needed. `rm -rf /var/lib/apt/lists/*` is more important See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run