`Deno run` command with permission flags not working inside container
I'm encountering an issue with running a Deno script inside a container (deno and chromium installed). When I execute the following command with specific permission flags:
deno run --allow-read--allow-env --allow-write --allow-run="/usr/bin/chromium" --allow-net /test/index.ts
it results in a timeout error. I've tried using -A (which grants all permissions) but it leads to the same error.
However, when I run the command without any flags:
deno run /test/index.ts
Deno prompts me for permissions, and after granting them (by typing A), the script executes successfully.
Why does the script work when granting permissions manually but fail when using the corresponding flags? What could be causing this discrepancy?11 Replies
Can you give more details as to what does the
Dockerfile
look like, for example, so we can try to replicate?
Also which deno version you're using.
I remember the denoland/deno:alpine
requiring --allow-all
or -A
in CMD
in order to work, but it doesn't seem like it's the same issue you're experiencing.https://github.com/StaytunedLLP/dagger-puppeteer here is a link to repo.. we are trying with dagger. we have taken chromium as base image, installed latest deno on top of it and tried to run index file by passing all flags
@marvinh. can you please help here
@Bhaumin I don't see any dockerfiles in the linked repo. Running the puppeter script locally with Deno 2.0.2 works as expected:
yes locally it is working..we are using dagger to create a container and run puppeteer and deno inside it.. there is no dockerfile for this. we have taken linuxserver/chromium:latest as base image. you can see that code inside example/src/index.ts file
How do I run that code? I'm not familiar with dagger.
ok will provide dockerfile for this so you can run that and check
I have added dockerfile.
Follow below steps to reproduce the issue
1. From repository root folder, Run
docker build -t deno-puppeteer .
2. Run docker run -it deno-puppeteer
3. Open interactive terminal of docker.
4. Run /config/.deno/bin/deno run --allow-read --allow-env --allow-write --allow-run --allow-net --allow-sys index.ts
. It will throw an error of timeout.
5. If you run /config/.deno/bin/deno run index.ts
and provide all permission then it will work.Maybe you're missing a specific permission like
--allow-ffi
?
When you do the interactive version, instead of A to allow all, can you check one by one what's being requested?
Oh, you mentioned even with --allow-all
it didn't work.yes we tried with both permissions but not working
have you check with dockerfile? and suggestion for deno command?
@marvinh. can you please help here to solve this?
I'm not able to reproduce the described problem. Both commands work without erroring for me
are you trying inside container?
yes