diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 9e6f334..9175e05 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2259,7 +2259,11 @@ function _drupal_exception_handler($exception) {
 
   try {
     // Log the message to the watchdog and return an error page to the user.
-    _drupal_log_error(_drupal_decode_exception($exception), TRUE);
+    $response = _drupal_log_error(_drupal_decode_exception($exception), TRUE);
+    // _drupal_log_error() only returns a Response in fatal error cases.
+    if (!is_null($response)) {
+        $response->send();
+    }
   }
   catch (Exception $exception2) {
     // Another uncaught exception was thrown while handling the first one.
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 819e671..af227da 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -3,10 +3,9 @@
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Install\TaskException;
+use Drupal\Core\DependencyInjection\MaintenanceContainerBuilder;
 use Drupal\Core\Language\Language;
 
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 
@@ -331,31 +330,9 @@ function install_begin_request(&$install_state) {
     $kernel->boot();
   }
   else {
-    // @todo Move into a proper Drupal\Core\DependencyInjection\InstallContainerBuilder.
-    $container = new ContainerBuilder();
-
-    $container->register('event_dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher');
-
-    $container->register('config.storage', 'Drupal\Core\Config\InstallStorage');
-    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
-      ->addArgument(new Reference('config.storage'))
-      ->addArgument(new Reference('event_dispatcher'));
-
-    // Register the 'language_manager' service.
-    $container->register('language_manager', 'Drupal\Core\Language\LanguageManager');
-
-    // The install process cannot use the database lock backend since the database
-    // is not fully up, so we use a null backend implementation during the
-    // installation process. This will also speed up the installation process.
-    // The site being installed will use the real lock backend when doing AJAX
-    // requests but, except for a WSOD, there is no chance for a a lock to stall
-    // (as opposed to the cache backend) so we can afford having a null
-    // implementation here.
-    $container->register('lock', 'Drupal\Core\Lock\NullLockBackend');
-
-    // Register a module handler for managing enabled modules.
-    $container
-      ->register('module_handler', 'Drupal\Core\Extension\ModuleHandler');
+    // MaintenanceContainerBuilder sets up container with suitable services
+    // for maintenance mode already registered.
+    $container = new MaintenanceContainerBuilder();
     drupal_container($container);
   }
 
diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index 0b426e2..f8fea7c 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -4,6 +4,8 @@
  * @file
  * Theming for maintenance pages.
  */
+use Drupal\Core\DependencyInjection\MaintenanceContainerBuilder;
+use Symfony\Component\DependencyInjection\Reference;
 
 /**
  * Sets up the theming system for maintenance page.
@@ -42,6 +44,16 @@ function _drupal_maintenance_theme() {
       require_once DRUPAL_ROOT . '/core/includes/database.inc';
     }
 
+    // Bootstrap a minimal container if one hasn't been created yet.
+    if (is_null(drupal_container())) {
+      $container = new MaintenanceContainerBuilder();
+      drupal_container($container);
+    }
+
+    // Need caching to be configured but don't actually want it in this situation.
+    require_once DRUPAL_ROOT . '/core/includes/cache.inc';
+    $conf['cache_classes'] = array('cache' => 'Drupal\Core\Cache\NullBackend');
+
     // We use the default theme as the maintenance theme. If a default theme
     // isn't specified in the database or in settings.php, we use Bartik.
     // @todo Should use the actual default theme configured, but that depends on
diff --git a/core/lib/Drupal/Core/DependencyInjection/MaintenanceContainerBuilder.php b/core/lib/Drupal/Core/DependencyInjection/MaintenanceContainerBuilder.php
new file mode 100644
index 0000000..e2bc951
--- /dev/null
+++ b/core/lib/Drupal/Core/DependencyInjection/MaintenanceContainerBuilder.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @file
+ * Extend ContainerBuilder to build a Container with the minimal registered 
+ * services necessary for bootstrapping Drupal in maintenance mode.
+ */
+
+namespace Drupal\Core\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\Reference;
+
+/**
+ * Dependency injection container builder for maintenance mode.
+ * Registers the following service definitions on instantiation:
+ *  - event_dispatcher
+ *  - config.storage
+ *  - config.factory
+ *  - language_manager
+ *  - lock
+ *  - module_handler
+ */
+class MaintenanceContainerBuilder extends ContainerBuilder {
+  /**
+   * Overrides Symfony\Component\DependencyInjection\Container::__construct().
+   *
+   * Configure the container for maintenance mode by registering some relevant
+   * service definitions.
+   */
+  public function __construct()
+  {
+    // Set up the base ContainerBuilder first.
+    parent::__construct();
+
+    // Register service definitions.
+    $this->register('event_dispatcher', 
+        'Symfony\Component\EventDispatcher\EventDispatcher');
+    $this->register('config.storage', 'Drupal\Core\Config\InstallStorage');
+    $this->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+      ->addArgument(new Reference('config.storage'))
+      ->addArgument(new Reference('event_dispatcher'));
+    
+    $this->register('language_manager', 'Drupal\Core\Language\LanguageManager');
+
+    // Maintenance mode cannot use the database lock backend since the database
+    // may not be fully up, so we use a null backend implementation.
+    // The site will use the real lock backend when doing AJAX
+    // requests but, except for a WSOD, there is no chance for a a lock to stall
+    // (as opposed to the cache backend) so we can afford having a null
+    // implementation here.
+    $this->register('lock', 'Drupal\Core\Lock\NullLockBackend');
+
+    // Register a module handler for managing enabled modules.
+    $this->register('module_handler', 'Drupal\Core\Extension\ModuleHandler');
+  }
+}
+
