Skip to content

chown: /var/www/html: Operation not permitted #74

@adam-clarey

Description

@adam-clarey

Problem:
I'm trying to replicate the docker4drupal infrastructure in a bitbucket pipeline to run the automated tests. I cant just use the php image (which does work and can run unit tests, but not browser based tests) as the primary image in the pipeline, so instead i'm running 'docker-compose up' within a docker container (see pipeline script).

Pretty much all the containers startup as expected (chrome, memchached etc), however php and nginx images do not startup. Running 'docker-compose ps' shows both of those containers with status 'Exit 1'.

I've tried everything I can think of regarding permissions, such as setting 'user' : 'root' in the php container, changing the permissions on the host container etc. I've run out of ideas so hoping someone can point me in the right direction.

To make things simpler to debug, I have removed all containers from docker-compose.yml leaving only the php container.

Screenshot 2020-09-13 at 09 59 04

docker-compose.yml

version: "3"

services:

  php:
    image: wodby/drupal-php:latest
    container_name: "${PROJECT_NAME}_php"
    user: root
    command: 'php-fpm -R'
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      PHP_FPM_USER: root
      PHP_FPM_GROUP: root

    volumes:
    - ./:/var/www/html
    - ./files:/mnt/files

bitbucket-pipeline.yml

pipelines:
  default:
    - step:
        services:
          - docker
        caches:
          - docker
        script:
          - echo `uname -s`-`uname -m`
          - curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
          - chmod +x /usr/local/bin/docker-compose
#          - chown -R 1000:1000 ../build
#          - chown -R 82:82 ../build
          - whoami
          - pwd
          - ls -al
          - ls -al ../
          - docker-compose up -d 
          - docker-compose ps
          - docker logs iYieldValuation_php
          - docker exec iYieldValuation_php composer install --no-interaction
          - docker exec iYieldValuation_php vendor/bin/phpunit web/core/modules/action
          - docker-compose down

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions