Running shell script during image build

I have docker file as below … .

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
.........
......

Inside this docker file, I have one shell script, that runs and generate some files. I have below statements for this…

USER root
RUN ./Release.sh

This executed as expected on my laptop.

image

Now on build server same docker file while building throws different error like file not found etc.

=> CACHED [final 8/9] RUN chmod -R 777 /app/Logs                                                                                         0.0s
 => ERROR [final 9/9] RUN ./Release.sh                                                                                                    0.3s
------
 > [final 9/9] RUN ./Release.sh:
: not foundease.sh: 2:
: not foundease.sh: 5:
: not foundease.sh: 43:
: not foundease.sh: 45:
------
Dockerfile:41
--------------------
  39 |     RUN chmod -R 777 /app/Logs
  40 |
  41 | >>> RUN ./Release.sh
  42 |
  43 |

On Laptop -

docker context ls
NAME              DESCRIPTION                               DOCKER ENDPOINT                               ERROR
default           Current DOCKER_HOST based configuration   npipe:////./pipe/docker_engine
desktop-linux *   Docker Desktop                            npipe:////./pipe/dockerDesktopLinuxEngine
desktop-windows   Docker Desktop                            npipe:////./pipe/dockerDesktopWindowsEngine

On Build Server

PS C:\Users\Administrator> docker context ls
NAME              DESCRIPTION                               DOCKER ENDPOINT                             ERROR
default           Current DOCKER_HOST based configuration   npipe:////./pipe/docker_engine
desktop-linux *   Docker Desktop                            npipe:////./pipe/dockerDesktopLinuxEngine

Both machines are on latest version of docker and wsl… can some one help me to trouble shoot ?
After adding below statement, it executes, but files are not changed.

.....
SHELL ["chmod", "+x"]

RUN ./Release.sh 
......

Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

And how is it copied into the image? If the builder says the script is not found, it is not there. At least not where you expect it. I see nothing in your shared code snippets that could give us any idea why that script should exist.