Docker-compose set user and group on mounted volume

前端 未结 4 506
感情败类
感情败类 2020-12-07 15:36

I\'m trying to mount a volume in docker-compose to apache image. The problem is, that apache in my docker is run under www-data:www-data but the mounted directo

4条回答
  •  天涯浪人
    2020-12-07 16:12

    Adding rw to the end of the volume mount worked for me:

    services:
        httpd:
            image: apache-image
            ports:
                - "80:80"
            volumes:
                - "./:/var/www/app:rw"
            links:
                - redis
            command: /setupApacheRights.sh
    

提交回复
热议问题