Reputation: 557
I want to install nextcloud using the official image from the docker hub.
https://hub.docker.com/_/nextcloud/
I tried installing apache on 'Running this image with docker-compose' and copied that piece of code to yaml.
version: '2'
volumes:
nextcloud:
db:
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=test1234
- MYSQL_PASSWORD=test1234
- MYSQL_DATABASE=test
- MYSQL_USER=test
app:
image: nextcloud
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
restart: always
Running that file with the docker-compose up -d command results in an error.
ERROR: create _nextcloud: "_nextcloud" includes invalid characters for a local volume name, only a-za-z0-9 a-za-z0-9_.- are allowed
I think this is a problem because the part I put in the volume is blank and I get this error when I delete the part and run it.
ERROR: Named volume "db:/var/lib/mysql:rw" is used in service "db" but no declaration was found in the volumes section
In other posts, it is said that you should specify the absolute path, but it does not seem to me.
Is this how i run it ??
Upvotes: 4
Views: 9372
Reputation: 635
I suppose your folder where the compose is located has name _nextcloud
. The name of folder is prepended to all the global resources created by compose (like volumes or networks). So docker wants to create volume _nextcloud_nextcloud
it's not possible to create volumes starting with underscore character as message indicates. Change the folder name and you'll be fine.
Upvotes: 4