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

git not found in alpine image #586

Closed
krazyjakee opened this issue Nov 14, 2017 · 12 comments
Closed

git not found in alpine image #586

krazyjakee opened this issue Nov 14, 2017 · 12 comments
Labels

Comments

@krazyjakee
Copy link

krazyjakee commented Nov 14, 2017

npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR! 
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

Looks like it's missing from the current alpine image.
npm install is kinda fundamental to node and git is required to install certain dependencies.

Including

RUN apk update && apk upgrade && \
    apk add --no-cache bash git openssh

in the dockerfile will fix it.

@LaurentGoderre
Copy link
Member

There was a discussion about this here: #367

If you only need it for npm, you should use a multi-stage build.

@SimenB
Copy link
Member

SimenB commented Nov 15, 2017

I don't think anything has changed from our side since #367, so closing

@tarampampam
Copy link

tarampampam commented Oct 5, 2018

If anyone need to use node (alpine) with git, take a look into this repository: https://github.com/tarampampam/node-docker

@alexisdiel
Copy link

RUN apk add --no-cache git

@JeremyCraigMartinez
Copy link

@alexisdiel what if we do not have permissions to install using apk? Is there an alpine binary we could grab?

@LaurentGoderre
Copy link
Member

@JeremyCraigMartinez are you able to compile from source?

@NuKESec

This comment has been minimized.

@benjamingr
Copy link
Member

Hi, @NuKESec this sort of comment is entirely inappropriate in the Node.js organization repo. Please see our code of conduct on how to conduct yourself inside the organisation.

@ivorscott
Copy link

ivorscott commented Jan 25, 2020

RUN apk add --no-cache git=2.22.2-r0 \
    --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community \
    --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/main

@vukanac
Copy link

vukanac commented Jun 2, 2020

The problem could be the user in Dockerfile. Looks like it requires to be installed by root.

copybara-service bot pushed a commit to google/gvisor that referenced this issue Jan 16, 2021
#5274 broke `make load-basic_fsstress` target. It works locally but for some
inconceivable reason it fails to build on Kokoro.

Error message:
```
Step 1/12 : FROM alpine
 ---> 1fca6fe4a1ec
Step 2/12 : RUN apk add git
 ---> Running in 109a5326259a
standard_init_linux.go:207: exec user process caused "no such file or directory"
The command '/bin/sh -c apk add git' returned a non-zero code: 1
make: *** [load-basic_fsstress] Error 1
tools/images.mk:149: recipe for target 'load-basic_fsstress' failed
```

Copied the approach from the following issue to achieve the same goal:
nodejs/docker-node#586 (comment).

PiperOrigin-RevId: 352188212
copybara-service bot pushed a commit to google/gvisor that referenced this issue Jan 19, 2021
#5274 broke `make load-basic_fsstress` target. It works locally but for some
inconceivable reason it fails to build on Kokoro.

Error message:
```
Step 1/12 : FROM alpine
 ---> 1fca6fe4a1ec
Step 2/12 : RUN apk add git
 ---> Running in 109a5326259a
standard_init_linux.go:207: exec user process caused "no such file or directory"
The command '/bin/sh -c apk add git' returned a non-zero code: 1
make: *** [load-basic_fsstress] Error 1
tools/images.mk:149: recipe for target 'load-basic_fsstress' failed
```

Copied the approach from the following issue to achieve the same goal:
nodejs/docker-node#586 (comment).

PiperOrigin-RevId: 352602945
@dcsan
Copy link

dcsan commented Sep 29, 2022

ssh: not found also...

@SimenB
Copy link
Member

SimenB commented Oct 1, 2022

We won't be adding any binaries to the alpine (or other images) - the images are supposed to be base images, plus node (and what it comes with, like npm, corepack etc.) and yarn. Any other dependcies needed should be installed by consumers

@nodejs nodejs locked as resolved and limited conversation to collaborators Oct 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests