Starefossen / docker-ruby-node

:whale: Alpine Docker Image with latest versions of Ruby, Node.js and yarn installed. This Docker Image is actively maintained and updated regularly.
https://hub.docker.com/r/starefossen/ruby-node/
MIT License
79 stars 44 forks source link

Use multistage builds #29

Open radeno opened 6 years ago

radeno commented 6 years ago

It should be easier to maintain and faster to build and deploy new images when we use multistage docker builds.

Any ideas what files we need to copy from official node image?

from /usr/local/bin:

from /usr/local/lib:

from /opt:

Am i missing something? Anyone with better linux experience. Are there any issues with copied binaries? Any potential performance degradation ?

radeno commented 6 years ago

I made first commit for combination 2-10 https://github.com/radeno/docker-ruby-node/tree/multistage/2-10 and build Docker images https://hub.docker.com/r/smikino/ruby-node/tags/

Size is identical (node manual is not copied), but build time is just couple of minutes on Docker Hub.

There are some issues because Docker COPY command can't copy symbolick links. So they must be created but RUN command.

Starefossen commented 6 years ago

I think this is the way to go forward. Would you be interested in creating a PR for this repository @radeno?

radeno commented 6 years ago

@Starefossen i could make PR. no problem for me. But need deeper testing

radeno commented 6 years ago

32 PR