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 · 10 comments
Closed

git not found in alpine image #586

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

Comments

@krazyjakee
Copy link

@krazyjakee 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

@LaurentGoderre LaurentGoderre commented Nov 14, 2017

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 SimenB commented Nov 15, 2017

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

@tarampampam
Copy link

@tarampampam 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

@alexisdiel alexisdiel commented Jan 11, 2019

RUN apk add --no-cache git

@JeremyCraigMartinez
Copy link

@JeremyCraigMartinez JeremyCraigMartinez commented Oct 16, 2019

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

@LaurentGoderre
Copy link
Member

@LaurentGoderre LaurentGoderre commented Oct 16, 2019

@JeremyCraigMartinez are you able to compile from source?

@NuKESec

This comment was marked as disruptive content.

@benjamingr
Copy link
Member

@benjamingr benjamingr commented Nov 4, 2019

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 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 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: 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants