protected function buildContainer()
    {
        $container = new ContainerBuilder(new ParameterBag($this->getContainerParameters()));
        $container->setResourceTracking(true);
        $container->set('kernel', $this);
        $container->set('application', $this->application);

        // Load the build file
        $this->getContainerLoader($container)->load($this->getBuildFile(), self::TYPE_BUILD_FILE);

        // Load the properties file
        $file = $this->getPropertiesFile();
        if ($file) {
            $this->getContainerLoader($container)->load($file, self::TYPE_PROPERTIES_FILE);
        }

        return $container;
    }