排除.dockerignore中的文件夹

我试图阻止我的Drupal composer项目中的文件和文件夹列表被包含在docker镜像中,但是作为一个意想不到的副作用,它也排除了一些在.dockerignore中没有明确定义的文件夹。 这是我正在使用的文件:

 # root files .gitignore .gitmodules .travis.yml .gitlab-ci.yml docker-compose.yml LICENSE phpunit.xml.dist README.md # folders .c9 .git backups/ vendor/ web/core/ web/modules/contrib/ web/profiles/ web/themes/contrib/ # web files web/.csslintrc web/.editorconfig web/.eslintrc web/.eslintignore web/.gitattributes web/.htaccess # web sites files web/sites/development.services.yml web/sites/example.settings.local.php web/sites/example.sites.php # web sites default files web/sites/default/files/ web/sites/default/default.services.yml web/sites/default/settings.local.php <all combinations of lines below, one at a time> 

我已经定义了我想包括在底部的文件夹,我已经尝试了所有我能想到的组合。 到目前为止没有运气,跑出来的东西尝试。

 # don't ignore comes last !web/themes/custom !web/libraries # don't ignore comes last !web/themes/custom/ !web/libraries/ # don't ignore comes last !web/themes/custom/* !web/libraries/* # don't ignore comes last *!web/themes/custom/* *!web/libraries/* 

我也尝试取消注释每个文件夹,并且web/themes/customweb/libraries文件夹仍然没有显示在我的docker镜像中。 我也有一个包含这些文件夹的.gitignore文件。 也许这是对这个奇怪的行为负责?

任何帮助,将不胜感激。

我正在用Gitlab CI构build图像,并且我忘记了我的git存储库没有我正在尝试复制的文件夹。 只有我的本地开发环境有文件夹。