How to solve Docker for Windows permission error

391 views Asked by At

I am currently facing some "permission denied"-issues with Docker for Windows 10.

I am using this image: Intersystems IRIS

My Dockerfile for this image is:

FROM store/intersystems/iris-community:2020.2.0.204.0

Furthermore I am using docker-compose, docker-compose.yml:

version: '2'
services:
backend:
    container_name: iris
    build: 
        context: ./container/IRISDataPlatform
        dockerfile: Dockerfile.yaml
    volumes:
        - ./container/IRISDataPlatform/ext:/external
    ports:
        - "9091:51773"
        - "9092:52773"
    environment:
        - ISC_DATA_DIRECTORY=/external/irissys
        - ICM_SENTINEL_DIR=/external
    command: --password-file /external/password.txt

The problem is whenever I execute docker-compose up -d the container exits after some seconds and shows following message:

[INFO] Initializing IRIS, please wait...

Starting IRIS

Invalid ownership for ./irisrecov

Initializing IRIS, please wait...

Starting IRIS

Recovery failure. Startup aborted.

[ERROR] Command "iris start IRIS quietly" exited with status 256

07/07/20-15:46:02:326 (374) 0 [Utility.Event] ISC_DATA_DIRECTORY=/external/irissys

07/07/20-15:46:02:353 (374) 0 [Utility.Event] Executing iris qlist

07/07/20-15:46:02:580 (374) 0 [Utility.Event] Versions are the same

07/07/20-15:46:02:596 (374) 0 [Utility.Event] Source /usr/irissys: 2020.2.0.204.0com

07/07/20-15:46:02:612 (374) 0 [Utility.Event] Destination /external/irissys: 2020.2.0.204.0com

07/07/20-15:46:02:627 (374) 0 [Utility.Event] Executing iris update IRIS directory=/usr/irissys datadir=/external/irissys versionid=2020.2.0.204.0com

07/07/20-15:46:02:680 (374) 0 [Utility.Event] Executing find /usr/irissys/ -type d -exec chmod ugo-w {} +

07/07/20-15:46:03:349 (374) 0 [Utility.Event] Executing chmod ugo-w /usr/irissys/

[ERROR] Possible causes:

[ERROR] - Incorrect user/group ownership of IRIS binaries

[ERROR] - Insufficient write permissions to ISC_DATA_DIRECTORY

[FATAL] Error starting InterSystems IRIS

What I tried so far:

  • Adding "user"-attribute to the backend-service and set it to "root" or "irisowner" -> Both not working
  • Adding "RUN adduser irisusr root && adduser irisusr irisusr" to my Dockerfile (as mentioned here: "https://community.intersystems.com/post/using-intersystems-iris-containers-docker-windows") but it ends in: "adduser Only root may add a user or group to the system" while docker-compose build

Do you know any fixes to this?

Thanks in advance

1

There are 1 answers

0
robert.c.cemper On BEST ANSWER

the sequence in your Dockerfile should look like similar to this:

FROM intersystemsdc/iris-community:latest   
USER root   
RUN adduser irisusr root && adduser irisusr irisusr  

USER irisowner  

You may use any template from OpenExchange as an example