Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access denied when running as Github action #7

Open
13hannes11 opened this issue Feb 23, 2022 · 5 comments
Open

Access denied when running as Github action #7

13hannes11 opened this issue Feb 23, 2022 · 5 comments

Comments

@13hannes11
Copy link

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
Copy link
Author

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
Copy link

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

@amake
Copy link
Owner

amake commented Apr 29, 2022

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

SundialTechnologies@da63fef

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
Copy link

teras commented Nov 13, 2022

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
Copy link

miurahr commented Jun 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants