Docker Community Forums

Share and learn in the Docker community.

Problem with mounted volume file system


(Php4u) #1

Expected behaviour

Any files created in container should be accessible in the container.
I’m installing magento inside docker container which has one volume linked

Actual behaviour

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file

  • Installing magento/magento-composer-installer (0.1.8)
    Loading from cache

Plugin installation failed, rolling back

  • Removing magento/magento-composer-installer (0.1.8)

[RuntimeException]
Could not delete /var/www/html/project/vendor/magento/magento-composer-installer/res/target.xml:

Information on files is only question marks (?) and they are not accessible

root@a2bfbab42c9c:/var/www/html/project/vendor/magento/magento-composer-installer/res# ls -lart
ls: cannot access target.xml: No such file or directory
total 1
-??? ? ? ? ? ? target.xml
drwxr-xr-x 3 root root 102 May 21 16:19 .
drwxr-xr-x 4 root root 136 May 21 16:20 …

Information

  • the output of:
    • pinata diagnose -u on OSX
      ls /var/root/Library/Group Containers/group.com.docker/bin//docker-diagnose
      ls: /var/root/Library/Group: No such file or directory
      ls: Containers/group.com.docker/bin//docker-diagnose: No such file or directory

Host is Mac OS 10.11.4
In docker-compose.yml I have

my_appdata:
build: docker-images/dataonly
volumes:
- ./src:/var/www/html/project

In source I have magento2

data-only Dockerfile is

FROM debian:jessie
COPY bin/entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]

Steps to reproduce the behavior

  1. docker-compose up -d
  2. go inside container and run composer install in /var/www/html/project

(Byronsmith) #2

Having the exact same issue with no luck! So happy (i think) to see someone else with the same issue

I’ve worked out it is as simple as moving files from one location to another on a shared host volume.

Steps to reproduce, every time.

Pull:
docker pull mysql

Run:
docker run -d -v /Users/username/Documents/data:/opt/:rw -e MYSQL_ROOT_PASSWORD=password mysql

Connect:
docker exec -t -i CONT_ID bash

cd /opt/
apt-get update
apt-get install git
git clone https://github.com/guzzle/promises.git
mv /opt/promises/src /opt/

Then ls -la /opt/src/ and all files permissions are FUBAR.

I’m using beta Docker for Mac
Docker version 1.11.1, build 5604cbe

If I do not use shared volumes, the permissions are not affected.


(Kgorskowski) #3

Same behavior here.
Trying to set up a Laravel environment with Laradock
I am using Volume containers for the workspace container, but composer install never finishes successfully.
Most file permissions are just messed up:
d??? ? ? ? ? ? Exception
-??? ? ? ? ? ? Loader.php
-??? ? ? ? ? ? Validator.php

Docker for Mac Environment is:

OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.1-beta12

Update: todays update to Docker.app: version v1.11.1-beta13 seems to have fixed it for me.


(Cedricmaucourt) #4

Same for me. Having a project using composer: some libraries installed after a composer install/update have entire folders with question marks instead of normal file informations. If I quit and start again Docker, it fixes the problem.


(Byronsmith) #5

beta13 resolves this


(Php4u) #6

Hi
I updated to beta13, yes initial error is gone and composer is running but then more issues arrived

Generating autoload files
Error response from daemon: No such exec instance 'b932481de6994c747652a36d6472e47a422ad18c0959b9012457ccf54900ba33' found in daemon

then after recreating container and trying to run composer again

Updating composer dependencies
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package videlalvaro/php-amqplib is abandoned, you should avoid using it. Use php-amqplib/php-amqplib instead.
Generating autoload files

                                                                                                                      
  [ErrorException]                                                                                                    
  file_put_contents(/var/www/html/project/app/etc/vendor_path.php): failed to open stream: No such file or directory  
                                                                                                                      

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

Folder is as follows

root@f868d6f4fa84:/var/www/html/project# ls -lart
total 854
drwxr-xr-x  3 root     root        102 May 26 07:16 db
-rw-r--r--  1 root     root     402108 May 26 07:16 composer.lock
-rwxr-xr-x  1 root     root       1949 May 26 07:16 composer.json
-rwxr-xr-x  1 www-data www-data    189 May 26 07:16 auth.json
drwxr-xr-x  3 root     root       4096 May 26 08:08 ..
drwxr-xr-x 31 root     root       1054 May 26 08:17 vendor
drwxr-xr-x  5 root     root        170 May 26 08:17 lib
drwxr-xr-x  3 root     root        102 May 26 08:17 var
-rw-r--r--  1 root     root       1427 May 26 08:17 package.json
-rw-r--r--  1 root     root       4108 May 26 08:17 nginx.conf.sample
drwxr-xr-x  4 root     root        136 May 26 08:17 bin
-rw-r--r--  1 root     root       3425 May 26 08:17 CONTRIBUTING.md
-rw-r--r--  1 root     root     440260 May 26 08:17 CHANGELOG.md
-rw-r--r--  1 root     root       6513 May 26 08:17 .htaccess.sample
drwxr-xr-x 11 root     root        374 May 26 08:17 pub
drwxr-xr-x  4 root     root        136 May 26 08:17 dev
-rw-r--r--  1 root     root        631 May 26 08:17 COPYING.txt
-rw-r--r--  1 root     root       1659 May 26 08:17 .php_cs
drwxrwxr-x 19 www-data www-data    646 May 26 08:17 .

More verbose output is

composer install -vvv
Reading ./composer.json
Loading config file /root/.composer/config.json
Loading config file /root/.composer/auth.json
Loading config file ./composer.json
Loading config file /var/www/html/project/auth.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Reading /root/.composer/composer.json
Loading config file /root/.composer/config.json
Loading config file /root/.composer/auth.json
Loading config file /root/.composer/composer.json
Loading config file /root/.composer/auth.json
Reading /var/www/html/project/vendor/composer/installed.json
Reading /root/.composer/vendor/composer/installed.json
Loading plugin MagentoHackathon\Composer\Magento\Plugin
activate magento plugin
Running 1.1.1 (2016-05-17 12:25:44) with PHP 7.0.6 on Linux / 4.4.11-moby
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Reading ./composer.lock
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Reading ./composer.lock
Resolving dependencies through SAT
Dependency resolution completed in 0.011 seconds
Analyzed 527 packages to resolve dependencies
Analyzed 4307 rules to resolve dependencies
Nothing to install or update
Package videlalvaro/php-amqplib is abandoned, you should avoid using it. Use php-amqplib/php-amqplib instead.
Generating autoload files
start magento deploy via deployManager
jump over deployLibraries as no Magento libraryPath is set

                                                                                                                      
  [ErrorException]                                                                                                    
  file_put_contents(/var/www/html/project/app/etc/vendor_path.php): failed to open stream: No such file or directory  
                                                                                                                      

Exception trace:
 () at /var/www/html/project/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:275
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 file_put_contents() at /var/www/html/project/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:275
 MagentoHackathon\Composer\Magento\Plugin->saveVendorDirPath() at /var/www/html/project/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:152
 MagentoHackathon\Composer\Magento\Plugin->onNewCodeEvent() at n/a:n/a
 call_user_func() at phar:///bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:170
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:95
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///bin/composer/src/Composer/Installer.php:296
 Composer\Installer->run() at phar:///bin/composer/src/Composer/Command/InstallCommand.php:133
 Composer\Command\InstallCommand->execute() at phar:///bin/composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///bin/composer/vendor/symfony/console/Application.php:844
 Symfony\Component\Console\Application->doRunCommand() at phar:///bin/composer/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///bin/composer/src/Composer/Console/Application.php:221
 Composer\Console\Application->doRun() at phar:///bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///bin/composer/src/Composer/Console/Application.php:101
 Composer\Console\Application->run() at phar:///bin/composer/bin/composer:43
 require() at /bin/composer:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

(David Sheets) #7

@php4u What is the content of the OS X directory mounted as /var/www/html/project? Does it contain app? The file_put_contents function is receiving ENOENT because the app subdirectory appears to be missing.

Perhaps something about the present state of your application development environment is broken due to the regression in Beta 12? I’m thinking maybe a file containing a path like app/etc/vendor_path.php makes the assumption that the directory structure leading to the file exists but, due to previous issues, it does not.


(Php4u) #8

@dsheets The problem is that at the last step of composer when it is dumping autoloader container dies

Generating autoload files
Error response from daemon: No such exec instance 'b932481de6994c747652a36d6472e47a422ad18c0959b9012457ccf54900ba33' found in daemon

Then after recreating container app folder does not exists on host or in container, but I guess composer expects it there

Question it why container is lost? Is it amount of files (48k) causing this?