Docker can’t give permission to script in entrypoint

I’m trying to deploy a docker image on my rpi3+ (arm7). The entrypoint script work when run manually, but I cant manage to make it work directly in the dockerfile. I always get this error:
Permision denied : Unknow

Heres my docker.

WORKDIR /SenseAI.CollectionAgent
COPY /s .
USER root
CMD /bin/bash -c 'chmod +x /SenseAI.CollectionAgent/'
ENTRYPOINT ["/SenseAI.CollectionAgent/"]

The path of the file seems right.
I have tried so many different commands, but none worked.
The content of my is

set -x #echo on
apt-get update
apt-get install libreadline-dev -y
chmod +x Gateway/SenseaiZ3Gateway
dotnet SenseAI.CollectionAgent.dll

but I think the error really comes from launching

Thank you !

Source: StackOverflow