Jakob Nielsen
Jakob Nielsen

Reputation: 5198

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?

Upvotes: 5

Views: 6643

Answers (1)

Jarrod
Jarrod

Reputation: 1475

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.

Upvotes: 3

Related Questions