Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpine image should include git #366

Closed
deitch opened this issue Mar 28, 2017 · 7 comments
Closed

alpine image should include git #366

deitch opened this issue Mar 28, 2017 · 7 comments

Comments

@deitch
Copy link

deitch commented Mar 28, 2017

npm has its git repo as a dependency feature (see https://docs.npmjs.com/files/package.json#git-urls-as-dependencies). In order for it to work, of course, the git client must be available.

If you try to do a basic npm install in an alpine-based image, and one of the packages uses that feature, it will fail. Similarly, if anything in your package.json refers to a git URL rather than a semver version, it will fail.

Since git, therefore, is a requirement for basic npm usage, I would suggest it should be included in the alpine image via the Dockerfile.

Simple example (from package.json in /my/local/path):

  "dependencies": {
    "compression": "https://github.com/expressjs/compression#1.6.2"
  }

and then

docker run --rm -v /my/local/path:/usr/src/app -w /usr/src/app node:7.4-alpine npm install
@LaurentGoderre
Copy link
Member

I am inclined to agree! I will open a PR and we can continue the discussion there.

LaurentGoderre added a commit to LaurentGoderre/docker-node that referenced this issue Mar 28, 2017
@deitch
Copy link
Author

deitch commented Mar 28, 2017

That was quick, @LaurentGoderre! I am going to close this issue in favour of the PR.

Closed in favour of #367

@deitch deitch closed this as completed Mar 28, 2017
@haithkris
Copy link

haithkris commented May 31, 2018

Hi! I see that we did add git but not for all versions of node js. Is it possible to do the update so in future versions, git can be available? thank you!

@chorrell
Copy link
Contributor

No, git was not added.

@LaurentGoderre
Copy link
Member

We are not modifying the base image. Debian includes it alpine doesn't. With the introduction of multistage builds, it doesn't make sense for us to add git to alpine.

@ryanleecode
Copy link

ryanleecode commented Feb 13, 2019

This doesn't work if your package.json has packages that are to be installed directly from git.

@SimenB
Copy link
Member

SimenB commented Feb 13, 2019

just install it yourself if you need it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants