Comments (6)
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.
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.
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.
from docker-npm.
@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.
Closing, feel free to reopen.
from docker-npm.
Related Issues (20)
- Remove run-as-user command because it is also the entrypoint HOT 1
- Running npm start fails for electron projects HOT 2
- how can i forward env varriables to container?? HOT 7
- Npm and Yarn cache HOT 2
- Pass extra docker specific parameters HOT 9
- Build tools are missing HOT 1
- Local gulp not found in /src HOT 1
- Node 12
- Problem with alpine branch HOT 1
- add yarn support? HOT 7
- Running yarn --help attempts invokes self-update HOT 5
- Build tools in `alpine` images HOT 3
- Alpine image build time unnecessarily blocks ci workflow HOT 4
- browserSync has trouble when connecting to the external IP HOT 4
- yarn ".roadrunner.json" error HOT 2
- Invalid github SSL certificate results in empty executable scripts on `self-update` HOT 1
- Epic - Create a smarter installer for the container wrapper scripts HOT 1
- Epic - Migrate each build from it's version-branch to a sub-folder of a single branch HOT 1
- Add GID and UID environment variables to the wrapper script HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-npm.