Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose up Permission denied on Windows

Here is my docker-compose.yml

version: '2'
services:
  backend:
    tty: true
    build:
      context: project/backend
    environment:
      - VIRTUAL_HOST=*/api/*,https://*/api/*
      - VIRTUAL_HOST_WEIGHT=42

If I try to do

docker-compose up

on windows at somepoint I get:

[91m/bin/sh: 1: ./mvnw: Permission denied
[0m[31mERROR[0m: Service 'backend' failed to build: The command '/bin/sh -c ./mvnw package' returned a non-zero code: 126

I am using Windows 10 64 bit Professional Anybody has an idea on how to fix this?

like image 380
Jakob Abfalter Avatar asked Oct 18 '22 08:10

Jakob Abfalter


1 Answers

Looks like this is a bug with docker-compose. When building on Windows, the regular docker build command will set all files to -rwxr-xr-x, but it looks like docker-compose is not doing this. It will be fixed in the next release of compose.

https://github.com/docker/compose/issues/3065#issuecomment-191489901

The workaround, as suggested by dnephin is to add RUN chmod +x your/files to the end of your dockerfile.

like image 167
Jarrod Avatar answered Oct 30 '22 20:10

Jarrod