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

User/cjones/128612 fix docker permissions #21

Conversation

cjones-teradici
Copy link

Here is a pull request to fix some of the issues.
More to follow

@@ -56,11 +50,8 @@ COPY --from=build /app/demo/stub/threagile.yaml /app/threagile-stub-model.yaml

RUN mkdir /data

RUN chown -R 1000:1000 /app /data
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I assume you removed these lines because you were experiencing some errors while running the container.

  • What errors were you experiencing?
  • What version of docker were you running? (seems like an error in docker-for-linux)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experienced the same error as @cjones-teradici when trying to run threagile via the provided Docker image:

gholland@TERVDIU18AZR037 % docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -create-stub-model -output /app/work
panic: open /app/work/threagile-stub-model.yaml: permission denied
goroutine 1 [running]:
main.checkErr(...)
        /app/main.go:663
main.createStubModelFile()
        /app/main.go:3850 +0xab
main.parseCommandlineArgs()
        /app/main.go:3798 +0x26e5
main.main()
        /app/main.go:668 +0x19

Note that I have user namespace remapping setup on my docker daemon.

@cjones-teradici
Copy link
Author

cjones-teradici commented May 25, 2022 via email

@cschneider4711
Copy link
Member

It's good security practice to run processes in containers as some other low-privileged user instead of root (see for example https://medium.com/@mccode/processes-in-containers-should-not-run-as-root-2feae3f0df3b ). Possibly it would be clearer to also add group/user inside the Dockerfile via groupadd/useradd to make this more obvious, instead of only using the USER directive to switch to a non-root user.

@cjones-teradici
Copy link
Author

cjones-teradici commented May 25, 2022 via email

@cjones-teradici
Copy link
Author

Bump please?

@fluential
Copy link

fluential commented Jul 20, 2023

@cjones-teradici can we resolve conflicts and try to merge this into main?

@joreiche
Copy link
Collaborator

joreiche commented Feb 7, 2024

this pr has been resolved with #57

@joreiche joreiche closed this Feb 7, 2024
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

Successfully merging this pull request may close these issues.

6 participants