Docker-compose -f /path/ up not working 😢

Hello,

Maybe a dumb question :grimacing: but I cannot make it work using docker-compose -f ~/my/path/devilbox/docker-compose.yml up -d mysql, however when I cd ~/my/path/devilbox/' and then rundocker-compose up -d mysql`it works perfectly.

My docker-compose version is 1.24.0, build unknown

What am I doing wrong?

Thank you for your help.

Mauricio

------------------ ERROR MESSAGE ------------------

WARNING: The LOCAL_LISTEN_ADDR variable is not set. Defaulting to a blank string.
WARNING: The DEBUG_COMPOSE_ENTRYPOINT variable is not set. Defaulting to a blank string.
WARNING: The EXTRA_HOSTS variable is not set. Defaulting to a blank string.
WARNING: The BIND_TTL_TIME variable is not set. Defaulting to a blank string.
WARNING: The BIND_REFRESH_TIME variable is not set. Defaulting to a blank string.
WARNING: The BIND_RETRY_TIME variable is not set. Defaulting to a blank string.
WARNING: The BIND_EXPIRY_TIME variable is not set. Defaulting to a blank string.
WARNING: The BIND_MAX_CACHE_TIME variable is not set. Defaulting to a blank string.
WARNING: The BIND_LOG_DNS_QUERIES variable is not set. Defaulting to a blank string.
WARNING: The PHP_SERVER variable is not set. Defaulting to a blank string.
WARNING: The PHP_MODULES_ENABLE variable is not set. Defaulting to a blank string.
WARNING: The PHP_MODULES_DISABLE variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DEVILBOX_PATH variable is not set. Defaulting to a blank string.
WARNING: The MOUNT_OPTIONS variable is not set. Defaulting to a blank string.
WARNING: The HOST_PATH_HTTPD_DATADIR variable is not set. Defaulting to a blank string.
WARNING: The HTTPD_SERVER variable is not set. Defaulting to a blank string.
WARNING: The DEVILBOX_UI_ENABLE variable is not set. Defaulting to a blank string.
WARNING: The TLD_SUFFIX variable is not set. Defaulting to a blank string.
WARNING: The HTTPD_DOCROOT_DIR variable is not set. Defaulting to a blank string.
WARNING: The HTTPD_TEMPLATE_DIR variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_HTTPD variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_HTTPD_SSL variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_SERVER variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_MYSQL variable is not set. Defaulting to a blank string.
WARNING: The PGSQL_SERVER variable is not set. Defaulting to a blank string.
WARNING: The PGSQL_ROOT_USER variable is not set. Defaulting to a blank string.
WARNING: The PGSQL_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_PGSQL variable is not set. Defaulting to a blank string.
WARNING: The REDIS_SERVER variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_REDIS variable is not set. Defaulting to a blank string.
WARNING: The MEMCD_SERVER variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_MEMCD variable is not set. Defaulting to a blank string.
WARNING: The MONGO_SERVER variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT_MONGO variable is not set. Defaulting to a blank string.
ERROR: The Compose file '/home/mlopez/Nextcloud/devilbox/docker-compose.yml' is invalid because:
services.memcd.ports is invalid: Port ranges don't match in length
services.mongo.ports is invalid: Port ranges don't match in length
services.mysql.ports is invalid: Port ranges don't match in length
services.httpd.ports is invalid: Port ranges don't match in length
services.pgsql.ports is invalid: Port ranges don't match in length
services.redis.ports is invalid: Port ranges don't match in length
services.httpd.ports is invalid: Port ranges don't match in length

This is probably due to the fact that docker-compose expects an .env file from the location where you execute it (The project directory).

You should probably also change it via --project-directory:

docker-compose \
  --project-directory ~/my/path/devilbox/ \
  -f ~/my/path/devilbox/docker-compose.yml up -d mysql
1 Like

Also have a look at this project for easy startup/restart and shutdown:

1 Like

Thank you, @cytopia! It works using --project-directory .

I’ll also try devilbox-cli, it looks useful.