Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose Doesn't Work #400

Open
only-su opened this issue Jul 11, 2024 · 2 comments
Open

Docker Compose Doesn't Work #400

only-su opened this issue Jul 11, 2024 · 2 comments

Comments

@only-su
Copy link

only-su commented Jul 11, 2024

I setup a simple compose script, I aim to expand it to automate a certbot docker to update the lodestone certs. Sadly, trying to start the lodestone service via docker composer always return a rust error

lodestone-1  | The application panicked (crashed).
lodestone-1  | Message:  called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
lodestone-1  | Location: core/src/prelude.rs:70
lodestone-1  |
lodestone-1  | Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
lodestone-1  | Run with RUST_BACKTRACE=full to include source snippets.
lodestone-1 exited with code 0

I am able to setup a container normally but not via compose for some reason.

Please inform me if I can provide any more help. Thnaks for the awesome work!

Steps to reproduce

Create a file named docker-compose.yml with the following content:

services:
  lodestone:
    image: ghcr.io/lodestone-team/lodestone_core
    ports:
      - "16662:16662"
      - "25565:25565"
    restart: unless-stopped
    volumes:
      - ./lodestone_path:/home/user/.lodestone

Run docker compose up you will get the error.

@Ynng
Copy link
Member

Ynng commented Jul 11, 2024

try to create the ./lodestone_path folder first and make sure it doesn't have dubious permissions before running the docker container

@only-su
Copy link
Author

only-su commented Jul 11, 2024

oh! it really worked. That's strange running without creating the folder beforehand would create a folder with this permissions:
drwxr-xr-x 2 root root 4096 lodestone_path
while creating it myself:
drwxr-xr-x 2 su su 4096 lodestone_path
so the only difference is user and group

Sadly, this means a docker compose cant't roll as a standalone as user needs to create a folder beforehand. Could this behavior be changed somehow?

Also, I found a workaround but it is even stranger. I saw stack saying you can change the user docker compose create the files for but I didn't read it in full and went to test. I set the user: "${UID}:${GID}" to the lodestone service but forgot to set the .env file so my docker complained:

WARN[0000] The "UID" variable is not set. Defaulting to a blank string.
WARN[0000] The "GID" variable is not set. Defaulting to a blank string.

but now the lodestone service worked normally (!???) I double checked the folder was not created beforehand redoing the steps twice. Also the folder created has the same permissions that would make it crash before:
drwxr-xr-x 2 root root 4096 Jul 11 19:19 lodestone_path
I do not understand this fully but maybe it's of some interest to you. Would doing this harm my security somehow?

well, thank you! and in the case I achive my goal do you have a forum where I could post the script so other users can use it?

as always thank you for the awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants