简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM