Giter Club home page Giter Club logo

Comments (6)

mkenney avatar mkenney commented on May 28, 2024

Hi,

I'm not familiar with npx but it looks interesting. I'll do a bit more reading but can you describe how the part about caching the packages in $HOME works? Would that be driven by a npx configuration file or something?

from docker-npm.

dagomar avatar dagomar commented on May 28, 2024

Hi @mkenney,

npx is also new for me, but I understood it is possible to set a location for global files through the cli; it allows to specify the location of the npm cache by passing --cache. The docker command could then be something like:

docker run --rm -$term_type -v $(pwd):/src:rw -v $HOME/.ssh:/home/dev/.ssh:ro -v $HOME/{THE_CACHE_DIRECTORY}:/path/to/cache mkenney/npm:$TAG /run-as-user /usr/local/bin/$SCRIPT $@

Actually, come to think of it, it looks like it is not necessary to pass anything extra to npx, just mounting the right folder to the npm cache should work I think.

I'd need to do a bit more investigation on this though. I think it would need to be optional, so I'm uncertain how this would work best in the setup of your project, if it would be done by setting an environment variable or something else. If you like I can look into it and see if I can make it part of this, or we could do it seperately after this lands.

from docker-npm.

mkenney avatar mkenney commented on May 28, 2024

Ok, that makes sense. If you have any thoughts around how to implement that, that would be great. I'd be open to an environment variable with a sane default that mounts to $HOME/.npx or whatever the standard location is. I would expect that users who execute npx would like it to cache things automatically by default.

from docker-npm.

mkenney avatar mkenney commented on May 28, 2024

Related threads: #166, #167

from docker-npm.

mkenney avatar mkenney commented on May 28, 2024

@dagomar, @jgoux, this has been released. I also included changes for #166 and #167. To resolve #166 (and the cache issue here) I added mounting $HOME/.npm to all of the scripts.

Please take a look at the updated scripts and latest tags on hub.docker.com and let me know if you have any problems. Thank you!

from docker-npm.

mkenney avatar mkenney commented on May 28, 2024

Closing, feel free to reopen.

from docker-npm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.