Problem
drupal_container() is deprecated, and all calls in the core modules need to be replaced with Drupal::service().
One exception is where the module_handler service is requested:
<?php
drupal_container()->get('module_handler');
?>
which needs to be replaced with Drupal::moduleHandler() (#1957154: Replace calls to drupal_container()->get('module_handler') service with Drupal::moduleHandler())
Proposed resolution
Create patches for each core module.
Remaining tasks
To do
#2001202: Replace drupal_container() with Drupal::service() in the aggregator module
#2001044: Replace drupal_container() with Drupal::service() in the user module