bareos icon indicating copy to clipboard operation
bareos copied to clipboard

Fix Docker Entrypoint mod

Open FlorentPoinsaut opened this issue 2 years ago • 2 comments

Hello, I suggest this modification to fix this error

$ docker run --cap-drop all --user 100:101  --rm -it barcus/bareos-storage:21-alpine sh
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/docker-entrypoint.sh": permission denied: unknown.

FlorentPoinsaut avatar Dec 04 '23 09:12 FlorentPoinsaut

Hello @FlorentPoinsaut I tried to remove the chmod command from Dockerfile but at the end this file can not be executed any more ! Also with this new build i still got the same error

docker run --cap-drop all --user 100:101  --rm -it local/bareos-storage:21-alpine sh
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/docker-entrypoint.sh": permission denied: unknown.

As you can see I used bareos-storage:21-alpine as a test

barcus avatar May 22 '24 11:05 barcus

entrypoint.sh script should be executable. we can solve this issue with chmod a+x instead of chmod u+x but finally user 100 or group 101 is not able to change some bareos stuff unless we force the owner of mounted volumes/files, as you can see there:

docker run --cap-drop all --user 100:101  --rm -it local/bareos-storage:21-alpine sh
touch: /etc/bareos/bareos-config.control: Permission denied
chown: /var/lib/bareos/archive: Operation not permitted
chown: /var/lib/bareos/storage: Operation not permitted
/ $

barcus avatar May 22 '24 11:05 barcus