i2pd icon indicating copy to clipboard operation
i2pd copied to clipboard

Remove symbolic link in `Dockerfile`

Open vnghia opened this issue 2 years ago • 3 comments

This line

https://github.com/PurpleI2P/i2pd/blob/69ee6112b3b134c40e4446999ede613d985a9122/contrib/docker/entrypoint.sh#L9

is causing me trouble when I try to bind mount /home/i2pd/data/ with a named volume. My suggestion is we remove this line and add a --certsdir to $DEFAULT_ARGS which will point to /i2pd_certificates.

I can send a PR for this.

Furthermore, if I want to keep the data in the docker file persistent, I got this error after restart the container (without removing the bind volume): ln: /home/i2pd/data/certificates/i2pd_certificates: File exists

vnghia avatar Dec 29 '23 17:12 vnghia

I'm having the same issue and it also seems partly due to the Docker container using the i2pd user instead of root user. The whole Docker config needs some attention, I think. I've copied the certificates over into the data directory to eliminate that link, but am struggling to get it to change the owner to i2pd. But looks like now from the previous comment, that this may not work either.

Danie10 avatar Jan 05 '25 10:01 Danie10

You dont need to change the ownership of the certificates dir. The dirs are 755 and the files are 644, so everyone can read it. The only case where you'd want to make changes, is if you want to add your own certs for reseed/family.

yhaenggi avatar Jan 05 '25 13:01 yhaenggi

In my case, I was originally getting a permissions' error accessing the certificates. The reason is the service is using user i2p, and the certificates or physically saved in a location that root has access to. The user i2p cannot access that location. If I logged into the container as user i2p a "ls" command returned nothing as it could not access the location.

After I copied the certificates out to the /home/i2p/data/certificates directory, and now it just says "file exists".

But I do still think the docker compose file could be documented by someone who knows the setup.

Danie10 avatar Jan 05 '25 20:01 Danie10