docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
34.01k stars 5.23k forks source link

build permission #5840

Closed wirwolf closed 6 years ago

wirwolf commented 6 years ago

Description of the issue

Context information (for bug reports)

docker-compose version 1.20.1, build 5d8c71b
docker-py version: 3.1.4
CPython version: 3.6.4
OpenSSL version: OpenSSL 1.0.1t  3 May 2016
Client:
 Version:   18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24
 Built: Wed Mar 21 23:10:01 2018
 OS/Arch:   linux/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:  18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:    Wed Mar 21 23:08:31 2018
  OS/Arch:  linux/amd64
  Experimental: false
services:
  elasticsearch:
    container_name: microservice_skeleton_symfony_elasticsearch
    environment:
      ELASTIC_PASSWORD: '9200'
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      bootstrap.memory_lock: "true"
      cluster.name: docker-cluster
      http.host: 0.0.0.0
      transport.host: 127.0.0.1
    image: docker.elastic.co/elasticsearch/elasticsearch-platinum:6.2.3
    ports:
    - published: 9200
      target: 9200
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/elasticsearch/data:/usr/share/elasticsearch/data:rw
  mongodb:
    command: mongod --config /etc/mongod.conf
    container_name: microservice_skeleton_symfony_mongodb
    environment:
      MONGO_INITDB_DATABASE: admin
      MONGO_INITDB_ROOT_PASSWORD: pass
      MONGO_INITDB_ROOT_USERNAME: user
    image: mongo:3.4.6
    ports:
    - published: 27017
      target: 27017
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mongodb/config/mongod.conf:/etc/mongod.conf:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mongodb/initdb:/docker-entrypoint-initdb.d:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mongodb/data:/data/db:rw
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mongodb/logs:/var/log/mongodb:rw
  mysql:
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
      --init-connect='SET NAMES UTF8MB4;'
    container_name: microservice_skeleton_symfony_mysql
    environment:
      MYSQL_DATABASE: app
      MYSQL_PASSWORD: pass
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_USER: user
    image: mariadb
    ports:
    - published: 3306
      target: 3306
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mysql/config/my.conf:/etc/mysql/my.conf:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mysql/data:/var/lib/mysql:rw
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mysql/logs:/var/log/mysql:rw
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/mysql/initdb:/docker-entrypoint-initdb.d:ro
  nginx:
    build:
      context: /var/lib/jenkins/workspace/MinexExplorer/Skeleton test
      dockerfile: .docker/nginx/Dockerfile
    container_name: microservice_skeleton_symfony_nginx
    depends_on:
    - php
    ports:
    - published: 80
      target: 80
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/nginx/config/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/nginx/logs:/var/log/nginx:rw
    - /var/lib/jenkins/workspace/Skeleton_test/app:/var/www:rw
  php:
    build:
      context: /var/lib/jenkins/workspace/MinexExplorer/Skeleton test
      dockerfile: .docker/php/Dockerfile
    container_name: microservice_skeleton_symfony_php
    depends_on:
    - elasticsearch
    - mongodb
    - mysql
    - redis
    environment:
      COMPOSE_PROJECT_NAME: microservice_skeleton_symfony
      ELASTIC_HOST: elasticsearch
      ELASTIC_PASSWORD: '9200'
      ELASTIC_PORT: '9200'
      MONGO_DB_NAME: admin
      MONGO_PASSWORD: pass
      MONGO_PORT: '27017'
      MONGO_USERNAME: user
      MYSQL_DATABASE: app
      MYSQL_HOST: mysql
      MYSQL_PASSWORD: pass
      MYSQL_PORT: '3306'
      MYSQL_USER: user
      NGINX_PORT: '80'
      RABBITMQ_CONNECTION_PORT: '5672'
      RABBITMQ_DEFAULT_PASSWORD: pass
      RABBITMQ_DEFAULT_USER: user
      RABBITMQ_GUI: '15672'
      RABBITMQ_HOST: rabbitmq
      RABBITMQ_MANAGEMENT_PORT: '8080'
      RABBITMQ_VHOST: /
      REDIS_PORT: '6379'
    image: php:fpm
    links:
    - redis
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/conf/fpm/php-fpm.conf:/etc/php/7.1/fpm/php-fpm.conf:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/conf/fpm/pool.d:/etc/php/7.1/fpm/pool.d:rw
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/conf/fpm/php.ini:/etc/php/7.1/fpm/php.ini:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/conf/mods-available/xdebug.ini:/etc/php/mods-available/xdebug.ini:ro
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/logs:/var/log/php:rw
    - /var/lib/jenkins/.composer/cache:/root/.composer/cache:rw
    - /var/lib/jenkins/.composer/auth.json:/root/.composer/auth.json:rw
    - /var/lib/jenkins/.ssh:/root/.ssh:ro
    - /var/lib/jenkins/workspace/Skeleton_test/app:/var/www:rw
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/php/conf/supervisor:/etc/supervisor/conf.d:ro
  rabbitmq:
    container_name: microservice_skeleton_symfony_rabbitmq
    environment:
      RABBITMQ_DEFAULT_PASS: pass
      RABBITMQ_DEFAULT_USER: user
    hostname: rabbitmq
    image: rabbitmq:management
    ports:
    - published: 8080
      target: 8080
    - published: 5672
      target: 5672
    - published: 15672
      target: 15672
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/rabbitmq/data:/var/lib/rabbitmq:rw
  redis:
    build:
      context: /var/lib/jenkins/workspace/MinexExplorer/Skeleton test
      dockerfile: .docker/redis/Dockerfile
    container_name: microservice_skeleton_symfony_redis
    image: redis
    ports:
    - published: 6379
      target: 6379
    volumes:
    - /var/lib/jenkins/workspace/Skeleton_test/.docker/redis/data:/data:rw
version: '3.3'

Steps to reproduce the issue

  1. docker-compose build

    Observed result

PermissionError: [Errno 13] Permission denied: '/var/lib/jenkins/workspace/Skeleton_test/.docker/php/logs/fpm-error.log'

Expected result

Stacktrace / full error message

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 127, in perform_command
  File "compose/cli/main.py", line 280, in build
  File "compose/project.py", line 372, in build
  File "compose/service.py", line 998, in build
  File "site-packages/docker/api/build.py", line 150, in build
  File "site-packages/docker/utils/build.py", line 15, in tar
  File "site-packages/docker/utils/utils.py", line 121, in create_archive
OSError: Can not read file in context: /var/lib/jenkins/workspace/Skeleton_test/.docker/php/logs/fpm-error.log

Additional information

ubuntu linux 16.04

shin- commented 6 years ago

Not a bug.