Open Ulexus opened 6 years ago
This would be really awesome.
Have the benefits of both run types.
The easy (and reproducible) container from Source mode
, but still the small final size of the Pre-bundled mode
.
This appears to not be quite as simple as I had hoped, but it should still be doable. I just haven't had the time to devote to it yet.
PRs always welcome. :)
Can you tell a little about the struggle you've been experiencing? Perhaps sharing the knowledge can lead to a solution.
Essentially, the later versions of meteor expect to compile dependencies on the deployment machine. This used to be done preliminarily during the bundling phase, but more and more often, run-time compilation is needed.
In some respects, multi-stage builds will actually help this. Most of the mismatches have been caused by people creating the bundle on one architecture and deploying on another, mandating recompilation. A multi-stage build would mostly fix this kind of problem, since it would be expected that the same architecture would be used for building the container image as for running.
I just haven't done any testing to see if that is sufficient.
Now that Docker finally supports multi-stage builds, we should use them in order to reduce the footprint of the resulting images (separating build requirements from runtime requirements).