denoland / deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
https://hub.docker.com/r/denoland/deno
MIT License
883 stars 101 forks source link

Permission denied (os error 13) when writing to file from Dockerfile #317

Open luPhz opened 10 months ago

luPhz commented 10 months ago

I setup a directory like in the example https://github.com/denoland/deno_docker/tree/main/example

the only content of main.ts is await Deno.writeTextFile("hello.txt", "Hello World"); like in the deno examples.

running this on ubuntu $ docker build -t app . && docker run -it -v ${PWD}:/app -p 1993:1993 app lead to the error message

await Deno.writeTextFile("hello.txt", "Hello World");
^
    at async writeFile (ext:deno_fs/30_fs.js:805:7)
    at async file:///app/main.ts:1:1

Removing USER deno from the dockerfile works for the moment. What is going on here?