innosetup-docker icon indicating copy to clipboard operation
innosetup-docker copied to clipboard

Access denied when running as Github action

Open 13hannes11 opened this issue 3 years ago • 5 comments

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 avatar Feb 23 '22 14:02 13hannes11

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

13hannes11 avatar Feb 24 '22 16:02 13hannes11

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

aburgerhulft avatar Apr 27 '22 19:04 aburgerhulft

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.

amake avatar Apr 29 '22 00:04 amake

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.

teras avatar Nov 13 '22 00:11 teras

@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.

miurahr avatar Jun 08 '23 02:06 miurahr