ndelitski / rancher-alarms

Will kick your ass if found unhealthy service in Rancher environment
85 stars 20 forks source link

build alarms image with alpine-node #12

Closed ozbillwang closed 8 years ago

ozbillwang commented 8 years ago

Currently the image is built from official node image (start from 640MB). I built the image again from alpine-node image mhart/alpine-node, currently mhart/alpine-node doesn't support onbuild image (https://github.com/mhart/alpine-node/issues/56), so I built it by myself:

$ cat Dockerfile.alpine-node
FROM mhart/alpine-node:4

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ONBUILD COPY package.json /usr/src/app/
ONBUILD RUN npm install
ONBUILD COPY . /usr/src/app

CMD [ "npm", "start" ]

Then I got smaller image which is only 64.71MB.

$ docker build -t node -f Dockerfile.alpine-node .
$ docker tag node bwits/node:4-onbuild
$ docker push bwits/node:4-onbuild

$ cat Dockerfile
FROM bwits/node:4-onbuild

$ docker build -t rancher-alarms . 
$ docker tag rancher-alarms bwits/rancher-alarms
$ docker push bwits/rancher-alarms

$ docker images |grep alarms
bwits/rancher-alarms        latest              0f3a1ee66ac6        29 minutes ago      64.71 MB
rancher-alarms          latest              0f3a1ee66ac6        29 minutes ago      64.71 MB

I did test with this image, looks fine for me. You can also test it with

docker pull bwits/rancher-alarms

If you like this idea, I will raise PR to update Dockerfile

ndelitski commented 8 years ago

yep, totally agree! was thinking about shrinking image size. PR is welcome 👍

ozbillwang commented 8 years ago

Thanks, I will do that.

In the meantime, I tested with feature of slack only, could you please test with mail/smtp or others you think to check?