amake / innosetup-docker

Docker image to create Windows installer executables with Inno Setup
https://hub.docker.com/r/amake/innosetup
Creative Commons Zero v1.0 Universal
71 stars 31 forks source link

Access denied when running as Github action #7

Open 13hannes11 opened 2 years ago

13hannes11 commented 2 years ago

I am trying to run this container as part of a GitHub pipeline, locally everything runs, however, as GitHub Actions I get Error in Z:\work\setup.iss: File access denied.

This is even though I set chmod 777:

-rwxrwxrwx 1 runner docker     1856 Feb 23 14:21 setup.iss

This is the output I get from the action (https://github.com/13hannes11/focus_annotator/runs/5304797855?check_suite_focus=true):

Preprocessing
   Reading file: C:\Program Files\Inno Setup 6\ISPPBuiltins.iss
Parsing [Setup] section, line 7
Parsing [Setup] section, line 8
Parsing [Setup] section, line 9
Parsing [Setup] section, line 11
Parsing [Setup] section, line 12
Parsing [Setup] section, line 13
Parsing [Setup] section, line 14
Parsing [Setup] section, line 15
Parsing [Setup] section, line 16
Parsing [Setup] section, line 17
Parsing [Setup] section, line 20
Parsing [Setup] section, line 21
Parsing [Setup] section, line 22
Parsing [Setup] section, line 23
Parsing [Setup] section, line 24
Creating output directory: Z:\work\Output
Error in Z:\work\setup.iss: File access denied.
Compile aborted.
Error: Process completed with exit code 2.
13hannes11 commented 2 years ago

I found a workaround by copying files to the container manually:

docker container create --name setup amake/innosetup setup.iss
docker cp ./package setup:/work/
docker cp setup.iss setup:/work/
docker cp LICENSE.md setup:/work/
docker start -i -a setup
docker cp setup:/work/Output/. .
docker rm setup
aburgerhulft commented 2 years ago

I have the same issue , I figured it out that it is the uid mapping of the mounted volumes.

amake commented 2 years ago

I have a vague understanding of the uid issue, and I've seen a fork of this repo has done some related work:

https://github.com/SundialTechnologies/innosetup-docker/commit/da63fefca165d377abaad58e8e8fbfa7eb1552e1

But I don't really understand it enough to confidently apply any of it myself. In my CI I prepare things ahead of time with umask and chmod.

teras commented 1 year ago

I had a similar problem, when I tried to run this docker through podman. To remind you, podman runs with user permissions (not root), and if a docker has user configurations, there's sometimes a problem which needs to be handled.

This time I handled it using a brute force method: since it's a permissions problem (and since podman itself has no security issues if run as root) I regained the root permissions to innosetup docker file.

Here is my Dockerfile, in case someone finds any use to it:

FROM docker.io/amake/innosetup
USER root
ENV HOME /home/xclient
ENV WINEPREFIX /home/xclient/.wine
ENV WINEARCH win32
RUN chown -R root /home
WORKDIR /work
ENTRYPOINT ["iscc"]

Maybe the only required commands are only USER and RUN/chown, but just in case, I re-enter the last parts.

And this works for me.

miurahr commented 1 year ago

@teras wrote:

Here is my Dockerfile, in case someone finds any use to it: (Snip) And this works for me.

It works but it brings another permission issue. Generated files are owned by root.root and there is no write permission for the user.