Wazbat
Wazbat
DDeno
Created by Wazbat on 10/27/2024 in #help
permission denied error when running deno install inside dockerfile
Hi there, I'm in the process of trying to migrate my node app to deno, as I was really impressed with the recent deno 2 announcement I have the following dockerfile, slightly modified from the example.
FROM denoland/deno:2.0.3
# set DENO_DIR to avoid conflicts with google cloud
ENV DENO_DIR=./.deno_cache
ENV NODE_ENV=production

WORKDIR /app

# Prefer not to run as root.
USER deno

COPY deno.json .
COPY deno.lock .
RUN deno install

# These steps will be re-run upon each file change in your working directory:
COPY . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache src/index.ts

ENV PORT=8080
EXPOSE $PORT

CMD ["run", "--allow-all", "src/index.ts"]
FROM denoland/deno:2.0.3
# set DENO_DIR to avoid conflicts with google cloud
ENV DENO_DIR=./.deno_cache
ENV NODE_ENV=production

WORKDIR /app

# Prefer not to run as root.
USER deno

COPY deno.json .
COPY deno.lock .
RUN deno install

# These steps will be re-run upon each file change in your working directory:
COPY . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache src/index.ts

ENV PORT=8080
EXPOSE $PORT

CMD ["run", "--allow-all", "src/index.ts"]
However when trying to build this, I get an error when running the deno install step:
1.753 error: Failed caching npm package 'lodash.mapvalues@4.6.0'.
1.753
1.753 Caused by:
1.753 Permission denied (os error 13)
1.753 error: Failed caching npm package 'lodash.mapvalues@4.6.0'.
1.753
1.753 Caused by:
1.753 Permission denied (os error 13)
The package listed is random. Previously it was ky, before that it was logform. I'm at a loss, as deno install works fine on my windows machine
3 replies