deno_docker icon indicating copy to clipboard operation
deno_docker copied to clipboard

Repurpose DENO_DIR to deno's user home

Open x80486 opened this issue 3 years ago • 8 comments

Would be better to change DENO_DIR to use deno's user home instead of /deno-dir/?

Eventually, this is not an issue with the image, but something I'm facing with GitLab CI (and probably some other solutions) that it complains about caching folders outside the build (or user's home) sub-directory.

x80486 avatar Feb 20 '21 19:02 x80486

What did you have to set DENO_DIR to for gitlab-ci?

hayd avatar Feb 21 '21 09:02 hayd

The original file was like this:

default:
  cache:
    key: $CI_COMMIT_REF_SLUG
    paths:
      - $DENO_DIR/
  image: docker.io/hayd/alpine-deno:1.7.2 # https://hub.docker.com/r/hayd/alpine-deno/

stages:
  - verify

format:
  stage: verify
  rules:
    - if: $CI_COMMIT_BRANCH == "master"
    - if: $CI_MERGE_REQUEST_ID
  script:
    - deno fmt --check

Removing the cache key it's all I needed to remove the warnings and make the pipeline works without failing. I think setting DENO_DIR to /home/deno/.cache/deno (the defaults) makes sense and should probably fix this.

x80486 avatar Feb 21 '21 14:02 x80486

cc @lucacasonato for an opinion on this one.

hayd avatar Feb 21 '21 20:02 hayd

Hello folks...any progress on this one?

x80486 avatar May 09 '21 23:05 x80486

This makes sense to me, especially now that we store origin data (localStorage) in DENO_DIR.

lucacasonato avatar May 17 '21 18:05 lucacasonato

OK...that would be great then! 🥂

x80486 avatar Jun 08 '21 21:06 x80486

Question:

The README suggests to mount --volume $HOME/.deno:/deno-dir. On my $HOME/.deno, I only see the folder bin, even though I have some things cached already. So, what's the use case of --volume $HOME/.deno:/deno-dir?

felipecrs avatar Aug 27 '21 16:08 felipecrs

BTW, @x80486 you can set the DENO_DIR environment variable to be whatever you want, as a folder inside of the HOME if you prefer.

It does not make sense to set the default value for DENO_DIR inside the container to be /home/deno/.deno/cache, as the container can be run as not only deno, but root as well.

felipecrs avatar Aug 27 '21 16:08 felipecrs