4 ms·
> - Slow (wait 10 minutes to run the same repetitive setup steps like "npm install") That should happen any time you change dependencies if your Dockerfile is
by 1337shadow 6y ago
> - Slow (wait 10 minutes to run the same repetitive setup steps like "npm install")
That should happen any time you change dependencies if your Dockerfile is efficiently setup, not every time you change a line in runtime code ...
Maybe that:
COPY . .
RUN npm install
Is not what you should do to have an efficient docker build phase, did you try this instead ?
COPY package.json
RUN npm install
COPY . .
Multistage builds will help if you build in two languages in the same Dockerfile.
Anyway, still slow when you add/remove a package because it redownloads everything, my best trick is to share ~/.npm cache directory, but I manage this with buildah instead of docker build.
- colinchartier 6y agoOne of the benefits of Layerfiles vs Dockerfiles is that those two examples will do the same thing - we monitor which files are read so you don't have to micromanage copying specific steps. But I suppose "npm install" is a simplistic example, "npm run setup_our_ci_environment" would be a more likely step for a larger CI pipeline
- Too 6y agoImpressive, and scary. How does it work? Some kind of ptrace wrapping of each command? If this genuinely works reliably, this alone could be a good product. As someone said below, you should promote this feature more specifically.
- colinchartier 6y agoOS-level VFS wrapper (there are a few places you can put probes here, another approach might be eBPS) We used to sell the features, but that actually didn't work super well - maybe we can add a "technical details" page for the nerds ;)
- ignoramous 6y agoYes, please. If that impressive hypervisor tech can handle production, I see endless possibilities, including mitigating downtimes by teleporting workloads to different cloud vendors and different regions. Easier said than done, of course!
- ayewo 6y agoSeconding the request for more details. Hopefully, you'll put up a quick blog post or even a gist and share the URL with us :)