Devilbox: After initial run, it seems impossible changing HOST_PATH_MYSQL_DATADIR

Created on 3 Jul 2017  路  4Comments  路  Source: cytopia/devilbox

Hi,

I'm using devilbox on MacOs 10.10.5 + Docker 17.06.0-ce for Mac + docker-compose 1.14.0
After initial run, it seems impossible changing HOST_PATH_MYSQL_DATADIR

Step 1 : use default HOST_PATH_MYSQL_DATADIR=./data/mysql in .env file

 docker-compose up php mysql

works fine, ./data/mysql is populated with sub directory named as the mysql flavour chose in .env

Step 2 : change HOST_PATH_MYSQL_DATADIR=../data/mysql in .env file (note ../ this directory exists but is empty), the same command produces:

ERROR: for mysql Cannot create container for service mysql: invalid bind mount spec "ed5dda4a9a167c193e4488635871d22914061aaf29be5901eb77714ffd593045:etc/mysql/docker-default.d:rw": invalid volume specification: 'ed5dda4a9a167c193e4488635871d22914061aaf29be5901eb77714ffd593045:etc/mysql/docker-default.d:rw': invalid mount config for type "volume": invalid mount path: 'etc/mysql/docker-default.d' mount path must be absolute
ERROR: Encountered errors while bringing up the project.

Error message does not help a lot since it point to etc/

More tests with those steps:
1) updating ./.env 2) CTRL-C once docker-compose 3) docker-compose up php mysql (with at least two manual attempts)

  • works fine:
    using absolute path to the step1 (instead of ./)

  • does not work:
    using absolute path to the step2 (instead of ../)
    copying content of ./data/mysql (after successful step1) under ../data/mysql
    copying content of ./data/mysql (after successful step1) under ./data/mysql_alt (note ./)
    using empty ./data/mysql_alt
    note: deleting or keeping existing ./data/mysql/percona-5.6 (from step1) does not change anything

  • worse:
    I changed mysql flavor in ./.env (e.g. percona-5.7 instead of percona-5.6), it does a fresh pulling from cytopia/ but whatever HOST_PATH_MYSQL_DATADIR value failed as above
    ./data/mysql, ./data/mysql_alt, ../data/mysql

The only way I found for being able to get my mysql working again is .. to get back to step 1:
./data/mysql with percona-5.6
in that case after running twice (the first failed like others), docker-compose up php mysql is successful for subsequent times.

docker documentation

Most helpful comment

Just a quick thought: Could you do a docker-compose rm -f after shutting down, then change the .env value and start up again.

All 4 comments

@normance thanks for the bug report.

I will try to reproduce this.

Just a quick thought: Could you do a docker-compose rm -f after shutting down, then change the .env value and start up again.

thanks !
Changes work fine with this command ! Please update the doc with this magic bullet :)

@normance Can you have a look if this is sufficient and understandable:

https://github.com/cytopia/devilbox/pull/94/files

Was this page helpful?
0 / 5 - 0 ratings