【发布时间】:2017-08-10 20:09:28
【问题描述】:
我试图阻止将我的 Drupal 作曲家项目中的文件和文件夹列表包含在 docker 映像中,但作为一个意外的副作用,它也排除了一些未在 @987654322 中明确定义的文件夹@。这是我正在使用的文件:
# 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/custom 和 web/libraries 文件夹仍然没有出现在我的 docker 映像中。我还有一个包含这些文件夹的.gitignore 文件。也许这是造成这种奇怪行为的原因?
任何帮助将不胜感激。
【问题讨论】:
-
我无法从您提供的详细信息中重现这一点。请按照this answer 中的步骤,将您的结果与构建的输出以及在您的构建目录中运行的
find .一起发布。 -
问题已解决,请看下面的答案。
标签: docker dockerfile