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

Permission denied when running the docker command #2

Open
pythops opened this issue Apr 17, 2023 · 3 comments
Open

Permission denied when running the docker command #2

pythops opened this issue Apr 17, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@pythops
Copy link

pythops commented Apr 17, 2023

Describe the bug

Permission issue when running with the rootless docker or podman.

To reproduce

  1. Have rootless podman configured
  2. Run the following command
podman run --rm -it -v "$(pwd)":/app "orhunp/linuxwave:${TAG:-latest}"

You'll get the error

Reading 96 bytes from /dev/urandom
Saving to output.wav
Error occurred: error.AccessDenied

Expected behavior

Having output.wav in the current directory

Software information

  • OS: Arch linux
  • Rootless podman

Additional context

Solution
Remove those lines from the Dockerfile

chown 1000:1000 output.wav
USER 1000:1000

Note
You can remove -it option for docker or podman, it's not needed

Nice tool, GJ 💯

@pythops pythops added the bug Something isn't working label Apr 17, 2023
@orhun
Copy link
Owner

orhun commented Apr 19, 2023

Hello, thanks for reporting this! 🐻

Remove those lines from the Dockerfile

What do you think the consequences of removing those lines will be? I think in that case the container will be run as root which poses a security risk. How can we have a precaution about that?

You can remove -it option for docker or podman, it's not needed

Thank you! Removed in d06438a

@pythops
Copy link
Author

pythops commented Apr 20, 2023

What kinf of risks you're thinking about ?
For rootfull docker/podman, you can create a new user inside a container and run the commands with that user

@orhun
Copy link
Owner

orhun commented Apr 20, 2023

What kinf of risks you're thinking about ?

Anything that can be run as root could be dangerous. On top of that, we're mounting the current directory via -v "$(pwd)":/app so that's an additional risk. Maybe mounting as :ro is better in this case.

For rootfull docker/podman, you can create a new user inside a container and run the commands with that user

Does that fix this permission issue as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants