Q:

Magento2 outdated issues

I am creating a docker container for magento2. Made everything ready and  now I am getting this error from the running container. 

Previously had an permission issue fixed by changing the permission
  for directory required, than I got his error.

I tried this ./bin/magento setup:upgrade but didn't solve the problem.
1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Please update your modules: Run "composer install" from the Magento root directory.
The following modules are outdated:
Magento_Directory db schema version: defined in codebase - 2.0.1, currently installed - 2.0.2
Magento_Directory db data version: defined in codebase - 2.0.1, currently installed - 2.0.2
Magento_Catalog db schema version: defined in codebase - 2.2.3, currently installed - 2.2.4
Magento_Catalog db data version: defined in codebase - 2.2.3, currently installed - 2.2.4
Magento_Sales db schema version: defined in codebase - 2.0.7, currently installed - 2.0.9
Magento_Sales db data version: defined in codebase - 2.0.7, currently installed - 2.0.9

Exception #0 (Magento\Framework\Exception\LocalizedException): Please update your modules: Run "composer install" from the Magento root directory.
The following modules are outdated:
Magento_Directory db schema version: defined in codebase - 2.0.1, currently installed - 2.0.2
Magento_Directory db data version: defined in codebase - 2.0.1, currently installed - 2.0.2
Magento_Catalog db schema version: defined in codebase - 2.2.3, currently installed - 2.2.4
Magento_Catalog db data version: defined in codebase - 2.2.3, currently installed - 2.2.4
Magento_Sales db schema version: defined in codebase - 2.0.7, currently installed - 2.0.9
Magento_Sales db data version: defined in codebase - 2.0.7, currently installed - 2.0.9
#0 /var/www/html/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(121): Magento\Framework\Module\Plugin\DbStatusValidator->beforeDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Magento\Framework\App\Request\Http))
#1 /var/www/html/magento2/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#2 /var/www/html/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#3 /var/www/html/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#4 /var/www/html/magento2/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#5 /var/www/html/magento2/lib/internal/Magento/Framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#6 /var/www/html/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#7 /var/www/html/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()
#8 /var/www/html/magento2/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main}

A:

This is poor error messaging on the part of Magento
The following modules are outdated:
Magento_Directory db schema version: 
    defined in codebase - 2.0.1, currently installed - 2.0.2

A better error message might have been "your system database is configured with modules ahead of those in your codebase.
Somehow, the module.xml files on your system.                
#File: vendor/magento/module-directory/etc/module.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Magento_Directory" setup_version="2.0.1">
        <sequence>
            <module name="Magento_Store"/>
        </sequence>
    </module>
</config>

have one version number, but the data in the setup table in MySQL (or cached values read from this table)
mysql> SELECT * FROM setup_module WHERE module = 'Magento_Directory';
+-------------------+----------------+--------------+
| module            | schema_version | data_version |
+-------------------+----------------+--------------+
| Magento_Directory | 2.0.2          | 2.0.2        |
+-------------------+----------------+--------------+

Somehow you've updated your system with one set of module files, but the system you're actually serving your files from is still an older one.     

