orhun / rustypaste

A minimal file upload/pastebin service.
https://blog.orhun.dev/blazingly-fast-file-sharing
MIT License
757 stars 47 forks source link

read-only config.toml in Docker image #249

Closed giondo closed 3 months ago

giondo commented 6 months ago

I'm trying to deploy this into a kubernetes and I ran into 2 issues

  1. running the docker image without a config.toml is not supported (perhaps creating a base at runtime would be nice)
  2. using a config-map (read only file) for the config-map gets an permission error

Error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

any suggestion?

Thanks

orhun commented 6 months ago

Hey, I'm not familiar with kubernetes. Can you maybe try mounting the config file as rw and see if the issue is fixed?

F-TD5X commented 6 months ago

I guess you are mount to folder/config with other permissions.

The docker container is using uid:gid as 1000:1000.

orhun commented 6 months ago

I tried to mount the config file as :ro into the container and it actually worked:

docker run --rm   -v "$(pwd)/upload/":/app/upload   -v "$(pwd)/config.toml":/app/config.toml:ro   --env-file "$(pwd)/.env"   -e "RUST_LOG=debug"   -p 8000:8000   --name rustypaste   orhunp/rustypaste

The docker container is using uid:gid as 1000:1000.

Yeah, that should be fine.

So I'm not sure what's going on in your case or how to fix it 😕

orhun commented 3 months ago

Closing for now, let me know if you still have this issue.