Closed fhaefemeier closed 2 years ago
I'm not able to reproduce, since it's permissions related it's either something with the volume mounts or maybe pre-existing data with the named volumes
docker-compose.yml
version: '3.1'
volumes:
files:
plugins:
services:
redmine:
image: redmine:4-alpine
user: "1005:1005"
environment:
# ------ Redmine configuration
REDMINE_DB_POSTGRES: db
REDMINE_DB_USERNAME: redmine
REDMINE_DB_PASSWORD: pass
# ------ Force correct time zone
TZ: Europe/Berlin
volumes:
- "files:/usr/src/redmine/files"
- "plugins:/usr/src/redmine/plugins"
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: pass
POSTGRES_USER: redmine
I started with a fresh installtion (like you) and everything seems fine. The rails server process is running under the right user id and no errors happen during start time. I did not make any further application tests...
After that I copied the plugin redmine_issue_todo_lists
in the docker volume with command
docker run --rm -u 999:1000 -v test_plugins:/plugins -v ${PWD}/plugins:/download -it alpine \
cp -r /download/redmine_issue_todo_lists /plugins
I have to use the user 999:1000 because these are the ownership of the docker volume created by docker-compose during the first docker-compose up -d
call (as all files and directories inside of the container). After this I restart redmine with docker-compose restart redmine
. The same error happen as described in my original message. It seems someone/something tries to transfer files into the directory /usr/src/redmine/public/plugin_assets
. It isn't possible because the container is started with user 1005:1005, but all files and directories inside the container has ownership 999:1000.
It makes no difference to use up -d
instead of restart
.
Take a look into the docker-entrypoint.sh
I am wondering if _fix_permissions
is working as expected, because it is running under ownership 1005 but the directories has ownership 999 and it change only the permissions.
Unfortunately I'm not sure there's much more we can do to help here -- I'd suggest trying a dedicated support forum, such as the Docker Community Forums, the Docker Community Slack, or Stack Overflow.
It is, in my oppinion, not a general docker issue. It is related how docker-entrypoint.sh
script initialise your image with setting for example permissions in the function _fix_permissions
.
But I solved it by creating my own image using your image as base and setting the permissions by my own beside other stuff needed to get it running well in my environment.
Thanks for your time.
The issue is still not solved. @wglambert was on the right track to reproduce it but he needs to add a plugin with assets to the installation - tha assets will be extracted to /usr/src/redmine/public/plugin_assets but there is no permission
Workarond: create a mount for public/plugin_asset and set correct permissions
See https://github.com/docker-library/redmine/issues/336, especially https://github.com/docker-library/redmine/issues/336#issuecomment-2195404449 for some more recent discussion of this same issue.
Following the documentation on ducker hub I start my redmine setup (4-alpine image) with a dedicated user/group id.
After starting the service the log shows following message:
Maybe I miss something...