koajs / joi-router

Configurable, input and output validated routing for koa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any plan to use npm package instead of git commit for koa-router

thakkaryash94 opened this issue · comments

I try to package my node app with docker. I used node alpine for base image, of course for less container size, but node alpine does not contain git to minimise image size and we are using git for aheckmann-koa-router package, so my docker built is throwing an error for alpine version

npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/aheckmann/koa-router.git /ro
ot/.npm/_git-remotes/git-https-github-com-aheckmann-koa-router-git-19e60d9-704f0691: undefined

npm ERR! Linux 4.4.0-72-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--production"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

I verified in my app, this is the only package using git for koa-router, so it will be better if we use it npm package so that we can reduce the container size from 83MB to 14MB.

node docker image link

related #39

Yes only if I use default node image, but if I use node alpine image, then it will throw above error because package is using "koa-router": "git+https://github.com/aheckmann/koa-router.git#19e60d9", git commit and git is not available in node:alpine version to reduce docker image size.

I achieved this by using multi-stage docker build.

I achieved this by using multi-stage docker build.