tomsquest / docker-radicale

Docker image for Radicale calendar and contact server :calendar: + security :closed_lock_with_key: + addons :rocket:
GNU General Public License v3.0
591 stars 82 forks source link

Fix docker-compose volumes #102

Closed jakemayeux closed 2 years ago

jakemayeux commented 3 years ago

This fixes a bug when trying to start the container using docker-compose.

ERROR: for radicale  Cannot start service radicale: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/home/user/radicale/config" to rootfs at "/config" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

Also, I changed the path on the host to be relative to the docker-compose file so it no longer assumes the full path of the project.

jakemayeux commented 3 years ago

Build failed with this, seems like something is broken with Travis?

The command "echo "$DOCKER_PWD" | docker login -u "$DOCKER_USER" --password-stdin" failed and exited with 1 during .
tomsquest commented 3 years ago

Hi @jakemayeux ,

In your error message, there is Are you trying to mount a directory onto a file (or vice-versa). Can you tell me what is your ~/radicale/config? This config must be a directory, not a file. I know this is tricky, but Docker can only mount directories.

So the directories layout shoud be:

~/radicale
  subdir: config
     file: config
# which gives ~/radicale/config/config as a regular file
tomsquest commented 2 years ago

Hi @jakemayeux ,

Any news?

jakemayeux commented 2 years ago

I don't have ~/radicale/config but I do have a ~/docker-radicale/config which is a file. It looks like this change is not necessary anymore though.

I would still recommend making the change to the data mount. As it is now, the docker-compose.yml assumes this repository is cloned into ~/radicale. This change will allow it to work anywhere as long as data is in the same directory as docker-compose.yml

tomsquest commented 2 years ago

As it is now, the docker-compose.yml assumes this repository is cloned into ~/radicale.

Actually, there is no need to checkout the repo, at all. When running something along docker run ... tomsquest/radicale, the image is downloaded from docker hub. No need to checkout for 99% of use case. There is the 1% of people who want custom BUILD_UID/GID, and which need to build the image themselves, but that's it.

But maybe you are right, and the "default" data folder shoud better be in . than in ~.

Can you:

Thanks,

tomsquest commented 2 years ago

Thanks @jakemayeux !

tomsquest commented 2 years ago

You are now part of the pantheon: 60e455e9ae75a66ab80d8680fd3fa5d1be96b14b