meilisearch: Using Docker, Meilisearch v0.24 does not write data in /data.ms anymore
Describe the bug
Following the docs in Getting Started / Installation / Download and launch / Docker, it says that Meilisearch write data in /data.ms.
When new user try it with Docker using persistence volume, they will use -v $(pwd)/data.ms:/data.ms
.
But looking inside the folder, they will find no data.
To Reproduce Steps to reproduce the behavior:
- Go to https://docs.meilisearch.com/learn/getting_started/installation.html#download-and-launch
- Click on ‘Docker’ tab
- Copy/Paste the command to start using meilisearch
- Check your
$(pwd)/data.ms
folder on your host machine - No data is persist
Expected behavior Data appears in the right folder of the host machine
MeiliSearch version: v0.24
Additional context
When changing user https://github.com/meilisearch/MeiliSearch/issues/1757 the workspace dir has also changed. It is no more /data.ms
but /home/meili/data.ms
We could update the documentation or remove the WORDIR ${HOME}
and let it be in /data.ms
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 46 (25 by maintainers)
Commits related to this issue
- Merge #1329 1329: Fix docker installation command r=dichotommy a=curquiza ⚠️ This PR should be merged as soon as possible since it's a fix due to a breaking change introduced in v0.24.0 we did not a... — committed to meilisearch/documentation by bors[bot] 3 years ago
- Merge #1329 1329: Fix docker installation command r=guimachiavelli a=curquiza ⚠️ This PR should be merged as soon as possible since it's a fix due to a breaking change introduced in v0.24.0 we did n... — committed to meilisearch/documentation by bors[bot] 3 years ago
- Merge #2032 2032: Revert docker as non root PR r=curquiza a=ManyTheFish Revert #1759 hotfix for #1969 Co-authored-by: Maxime Legendre <maximelegendre@mbp-de-maxime.home> — committed to meilisearch/meilisearch by bors[bot] 3 years ago
On Debian 11 Server with Docker version 20.10.11, build dea9396
As a non-root user logged in to the server,
1. With meilisearch:latest aka v0.24.0 (/home/meili/data.ms)
Got
2. With meilisearch:latest aka v0.23.0 (/data.ms)
Works!
3. As @sanders41 mentionned (using -u root or -u 0:0) for v0.24.0
Works!
4. Chown mounted folder to 1000:1000
Works!
5. Using -u 1000:1000 (because meili user inside has uid=1000, gid=1000)
Got
For v0.24.0 (meili user), case 3 and 4 work with extra
Hi, @michaelbaudino thanks, I tried your solution and it works. However, I find it a bit patchy, and doesn’t seem to be a “clean” fix of our issue. 😞
But, I found a pretty long discussion about workarounds or features to fix this. There are:
Now @ all! (@michaelbaudino, @K2ouMais, @caugner, @sanders41, @sovanna, @FLevent29). Is your issue:
warning ⚠️
the current
getmeili/meilisearch:latest
doesn’t work with named volume too, but I can easily patch it to make it work.if you want to try named volumes, use this dummy Dockerfile:
build:
docker build -t dummy_meili .
run:
docker run -it --rm -v meilisearch_db:/home/meili/data.ms dummy_meili:latest
Don’t hesitate to give me more feedbacks about this! 🙏
Hum, regarding the error you have and also since the core-team does not have time to make the dockerfile works with a
meili
user, I think we have to roll back this change introduced in v0.24.0. I’ll let you know, but this problem will be fixed in v0.25.0.Thanks for your investigation @sanders41 and @sovanna. Also, sorry for this issue.
@ManyTheFish for me it is currently development, but the plan is to move the same setup to production once things are ready.
Hey all! I’m currently trying to fix this, but, because it’s not a trivial fix, we will revert the PR that introduces this bug for the
v0.25
and rewrite a new Dockerfile in another PR forv0.26
.Thanks for your feedbacks! 🙌
@FLevent29 if it is easier you can uses your
docker-compose.yaml
file for this instead of a separateDockerfile
.As a side note, you probably want to read your
MEILI_MASTER_KEY
from an environment variable rather than hard coding it inMEILI_MASTER_KEY: "masterKey"
because if you commit it to your repository people will be able to see it.Hello @sovanna, thank you so much for this report! 🙏 sorry for the breaking change we did not anticipate enough regarding the docs!
I will create a PR to update the documentation today 😃
Also, I opened a more general discussion about the
data.ms
path: https://github.com/meilisearch/product/discussions/332I will close the issue once it’s fixed in the docs.