Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda