Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Exclude folders in .dockerignore

I'm trying to prevent a list of files and folders from my Drupal composer project to be included in the docker image, but as an unintended side effect it's also excluding a few folders which aren't explicitly defined in the .dockerignore. Here's the file I'm working with:

# 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>

I've defined the folders I want to include at the bottom, I've tried all the combinations I could think of below. So far no luck and ran out of things to try.

# 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/*

I also tried to uncomment every folder, and the web/themes/custom and web/libraries folders still aren't showing up in my docker image. I also have a .gitignore file which contains these folders. Maybe this is responsible for this strange behavior?

Any help would be appreciated.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I was building the image with Gitlab CI, and I forgot that my git repository didn't have the folders that I was trying to COPY. Only my local development environment had the folders.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!