docker
docker copied to clipboard
/vendor/bin folder has empty files after running "composer install"
I'm trying to install Statamic on a docker-compose setup.
When I run "composer install" on XAMPP, I end up with a /vendor/bin folder that looks like this:

When I run the same command through my Docker setup, I get similar files, however, they're all 0 bytes and can't be opened.

My docker-compose.yaml file looks like this:
`version: '3'
networks:
statamic:
services:
site:
image: nginx:stable-alpine
container_name: nginx
ports:
- "8080:80"
volumes:
- ./src:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
- mysql
networks:
- statamic
mysql:
image: mysql:5.7.29
container_name: mysql
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
SERVICE_TAGS: dev
SERVICE_NAME: mysql
networks:
- statamic
php:
build:
context: .
dockerfile: php.dockerfile
container_name: php
volumes:
- ./src:/var/www/html
ports:
- "9000:9000"
networks:
- statamic
composer:
image: composer:latest
container_name: composer
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
depends_on:
- php
networks:
- statamic
npm:
image: node:13.7
container_name: npm
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
entrypoint: ['npm']
artisan:
build:
context: .
dockerfile: php.dockerfile
container_name: artisan
volumes:
- ./src:/var/www/html
depends_on:
- mysql
working_dir: /var/www/html
entrypoint: ['php', '/var/www/html/artisan']
networks:
- statamic`
After reading the Composer official docs I guess on UNIX systems the vendor/bin directory will contain symlinks. That must be what those files are.
The issue then becomes when I try to startup my site: "docker-compose -d --build" I get the following error:

The error in the last screenshot is from npm by the look of it. The files in vendor/bin are symlinks and should be callable even on windows
I have the same issue, does one know a fix?
have you got a repeatable case ? Could you upload the docker file for example ?
have you got a repeatable case ? Could you upload the docker file for example ?
Hi, I working through an online tutorial, after I install laravel and then install composer the files are all 0 which I think is symlink?
But when I run up -d --build I get the following issue

my docker file and env
Thats in the node one ? The docker compose file doesnt seen to have valid stuff in either, can you link the whole tutoral ?
This doesnt seem to be a composer issue though
Thats in the node one ? The docker compose file doesnt seen to have valid stuff in either, can you link the whole tutoral ?
This doesnt seem to be a composer issue though
Hi, I can't share as its a paid tutorial. I seem to have got this working on another project I was working on, I'm wondering if its installing the wrong dependencies. I've read about the package.lock file being wrong.
Possibly, that error is about node_modules not composer. If its paid, I would ask the author whats going wrong.
This is not a composer issue though
I have the same problem in the project without node_modules - it happens with vendor/bin contents as stated in the original post. There are empty files with restricted permissions, so docker up can't handle with it and can't build. If I delete those files manually, everything is ok.
@Seldaek I suggest closing this issue given that Composer does not generate symlinks anymore.
We still have symlinks for path repos, but yeah bin files are solved, I guess we can close here anyway as there isn't really anything actionable.