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

919
Vistas
Docker container tries to mount a directory that is a file

I am building craft cms in docker and I am getting the following error, when I execute docker-compose up:

ERROR: for craftcms Cannot start service craftcms: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\"/host_mnt/c/src/composer.lock\\" to rootfs \\"/var/lib/docker/overlay2/b7084475699f911f17d38746b21b1b9694fedf6e096a4080109d429fa687a6db/merged\\" at \\"/var/lib/docker/overlay2/b7084475699f911f17d38746b21b1b9694fedf6e096a4080109d429fa687a6db/merged/var/www/composer.lock\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.

Apparently, mounting directories in Windows OS is different than Linux OS. Could you please help me troubleshoot this?

enter image description here

UPDATE

From the docker-compose.yml, this is where I mount the files:

craftcms:
    build:
      context: .
      dockerfile: ./infrastructure/docker/php-fpm/Dockerfile
    expose:
      - 9000
    volumes:
      - cpresources:/var/www/web/cpresources
      - ./src/vendor:/var/www/vendor
      - ./src/composer.json:/var/www/composer.json
      - ./src/composer.lock:/var/www/composer.lock
      - ./src/config:/var/www/config
      - ./src/modules:/var/www/modules
      - ./src/templates:/var/www/templates
      - ./src/web:/var/www/web
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This typically indicates that src/composer.lock is either not a file, or that the drive where these files exist is not properly shared to the docker VM.

For the former, check the directory where you are running docker-compose from, this is the censored directory so I cannot provide you better details than that. You should have a src\composer.lock in there as a regular file, not a directory.

For the latter, go into the docker preferences, and reconfigure the drive sharing to ensure the drive with your compose project is included, and that docker has your current password (it performs a windows SMB mount to share the drive to the docker VM).

When docker tries to mount a file that does not exist as a host mount, the default action is to create a directory on the host (this may be only in the docker VM if the directory is not properly shared) and mount that directory inside the container. And if that is supposed to be a file instead of a directory inside the container, you will get an error.

over 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