nextindex/docker-suitecrm

Volume/mount warnings and errors leading to compose failure

Closed this issue · 4 comments

Expected Behavior

docker-compose up runs as outlined in the readme and as expected.

Actual Behavior

Volume/mount warnings and errors leading to compose failure.

When creating the container via compose:

ERROR: for dockersuitecrm_suitecrm_1  Cannot start service suitecrm: Mounts denied:
The paths /srv/docker/suitecrm/upload and /srv/docker/suitecrm/upload/config.php
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.

ERROR: for suitecrm  Cannot start service suitecrm: Mounts denied:
The paths /srv/docker/suitecrm/upload and /srv/docker/suitecrm/upload/config.php
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Environment

  • OS: macOS Sierra 10.12.5 (16F73)
  • Docker Version: 17.06.0-ce-mac18 (18433)
  • SuiteCRM Version: (version provided by this repo)

Quick Fix

You can side-step this by updating docker-compose.yml to use relative paths in the suitecrm volumes block:

 # ... snip ...
  suitecrm:
    build: src
    ports:
      - "8080:80"
    depends_on:
      - mysql
    volumes:
      -  ./upload:/var/www/html/upload
    environment:
      DB_TYPE: mysql
      DB_MANAGER: MysqlManager
 # ... snip ...

Doing this things will run and you will be taken through the installation. You will have to provide the database configuration information as that doesn't seem to carry in to the container(s) as expected but it's easy enough to copy/paste from the compose file for now.

This isn't ideal and defeats the env magic but will at least get things running until the project is updated to either guide volume/mount setup or adjust the compose file.

Oh thanks. Will look into this.

@ClockworkMichael

I am still working on a fix on that.

The probem however is that the config.php will be mounted on the host as a folder. Maybe I missunderstood the docker volume mounting 🤔 I will check the docs and try to fix it.

However, a better fix for you would be to simply create the config.php file. This way the docker-compose would start and you would have the config_overwrites which are working with the ENVS

And more important it would be updateable. SuiteCRM is a bit weird there, because it does not have a config.php per default. It generates one. So if you don't save the config.php in a volume it would be overwritten on every new version.

@apertureless when you run this on your machine(s) do you have a local config (perhaps at /srv/docker/suitecrm/upload/config.php that contains anything? Is it an empty file that's added as a volume for persistence?

If it's an empty file for persistence the compose file could be adjusted to be:

 # ... snip ...
  suitecrm:
    build: src
    ports:
      - "8080:80"
    depends_on:
      - mysql
    volumes:
      -  ./upload:/var/www/html/upload
      -  ./config.php:/var/www/html/config.php
    environment:
      DB_TYPE: mysql
      DB_MANAGER: MysqlManager
 # ... snip ...

And then there could be an empty uploads dir and an empty config.php file in the project root (could go elsewhere) that can be filled/used by SuiteCRM as needed.

I've tested this locally with our own docker/php setup and was able to get things working without issue doing something like this.

Fixed now :)