jprjr / docker-tinynode

A small buildroot-based image for Docker, with NodeJS installed. Clocks in around 30MB.
27 stars 7 forks source link

to run two node processes, docker docs suggests supervisor, how to install it? #3

Open urbien opened 9 years ago

urbien commented 9 years ago

I need two node processes to run inside the image. I would install supervisor as described in docker docs https://docs.docker.com/articles/using_supervisord/ but do not seem to have an apt-get in your image

jprjr commented 9 years ago

Hi there Gene - this particular image isn't based on Debian or Ubuntu, so it doesn't have apt.

Are you sure you need two instances of NodeJS in the same container? Maybe you could just run two different containers. If that doesn't work, you'll probably want to try another image based on Debian or Ubuntu

On February 13, 2015 3:31:20 PM CST, Gene Vayngrib notifications@github.com wrote:

I need to node processes to run inside the image. I would install super visor as described in docker docs https://docs.docker.com/articles/using_supervisord/ but do not seem to have an apt-get in your image


Reply to this email directly or view it on GitHub: https://github.com/jprjr/docker-tinynode/issues/3

Sent from my Android device with K-9 Mail. Please excuse my brevity.

urbien commented 9 years ago

John, thanks a a quick reply. Aside from the node, we will need some more processes running inside. The next one is Ethereum process. I talked to an admin friend of mine and he said that an app must be deployed as one logical unit with all its dependencies - thus one docker image. And your image is just perfect - so small. The previous base ubuntu image we used was 500M and after installing nodejs it grew 100M+ more. So a perfect solution would be to have your image with supervisord

jprjr commented 9 years ago

Hmm. Well, the thing about supervisord is it pulls in Python, which blows up the image a bit. The only way to really add stuff is to edit that "tinynode_defconfig" file and rebuild the image, which isn't super straightforward.

Something I'm working on is a way to compose small images similar to this one, where it would be really easy to say "I need NodeJS and Python" and get them both in there, but it's not anywhere near ready yet.

You might want to take a look at using an image based off of Alpine Linux, like this one: https://registry.hub.docker.com/u/gliderlabs/alpine/ - it's a really small, efficient distro.

I just tried making this Dockerfile:

FROM gliderlabs/alpine:3.1
RUN apk-install supervisor nodejs

And got this result:

REPOSITORY                              TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
nodejs_supervisor_test                  latest              ff0eccd613ae        About a minute ago   58.8 MB

Still very small!

urbien commented 9 years ago

thank you so much for the answers. Have you seen the http://blog.tutum.co/2014/12/02/docker-and-s6-my-new-favorite-process-supervisor/ It seems that s6 supervisor does not have dependencies and would be easier to include in your image.

urbien commented 9 years ago

man, this is your own article, how funny! But the question still stands, would it be easier to include s6 into your tiny nodejs image?

jprjr commented 9 years ago

haha! I'm getting a huge kick out of seeing somebody reference my own blog post!!

So, it would be very easy to include s6 into the tinynode image. But you mentioned wanting to get Ethereum running, which like I mentioned before, I have no idea what kind of requirements that has since I'm not familiar with it.

I think s6 is a great alternative to supervisor! I just wonder if your project is more than this image is really meant for - The Alpine Linux image sounds like it would be a good compromise between image size and the time needed to get all this built :)

urbien commented 9 years ago

:-) we need to work with

  1. bitcoin + bittorrent. For this we only need node.js and s6
  2. ethereum + bittorrent. For this we need https://github.com/ethereum/ethereum-dockers and I will look into Alpine, thank you for that pointer!

so nodejs + s6 still stands!

On Tue, Feb 17, 2015 at 2:50 PM, John Regan notifications@github.com wrote:

haha! I'm getting a huge kick out of seeing somebody reference my own blog post!!

So, it would be very easy to include s6 into the tinynode image. But you mentioned wanting to get Ethereum running, which like I mentioned before, I have no idea what kind of requirements that has since I'm not familiar with it.

I think s6 is a great alternative to supervisor! I just wonder if your project is a more than this image is really meant for - The Alpine Linux image sounds like it would be a good compromise between image size and the time needed to get all this built :)

— Reply to this email directly or view it on GitHub https://github.com/jprjr/docker-tinynode/issues/3#issuecomment-74739042.

borjaburgos commented 9 years ago

:clap: @jprjr is everywhere!