Docker build error:Error: spawn git ENOENT
See original GitHub issueDescribe the bug
I run vitepress in docker, it works fine when 1.0.0-alpha.4,after I upgrade 1.0.0-alpha15, it show errors:
after try times, I add one line code:
RUN apk add --no-cache git
then it works as before.so I want to know what casuse it?
Reproduction
FROM node:16.14-alpine AS builder
ENV PORT 80
ENV HOST 0.0.0.0
WORKDIR /usr/src/app
COPY package.json ./
# RUN apk add --no-cache git
RUN yarn
COPY . .
RUN yarn build
CMD yarn serve
Expected behavior
If I keep the dockfile as follows ,it still can work
FROM node:16.14-alpine AS builder
ENV PORT 80
ENV HOST 0.0.0.0
WORKDIR /usr/src/app
COPY package.json ./
RUN yarn
COPY . .
RUN yarn build
CMD yarn serve
System Info
Centos 8
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Build error inside alpine-node docker image: `Error: spawn git ...
next build command fails upon building artefact inside a Docker container ... Build error occurred {Error: spawn git ENOENT at Process.
Read more >VS Code Error: spawn git ENOENT - Stack Overflow
Try typing "git --version" in the system command line (do not use git bash by mistake). If you cannot see the version, it...
Read more >errno: -4058, code: 'enoent', syscall: 'spawn git', path - You.com
ENOENT means that a file does not exist. The path indicated is git . gh-pages is trying to use git but it seems...
Read more >Git node error can't clone or pull - Questions - n8n community
Describe the issue/error/question When I execute git node in my workflow, it can't pull or clone ... ERROR: Error: spawn git ENOENT at...
Read more >Error: spawn 'Files\Git\dist\' ENOENT - The system cannot find ...
When running npm run build Git Bash was changing my file path from the projects file path (C:\dev\sites\my-sitecore-site) to where git was ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You have lastUpdated set to true. To use it you need git installed. Disable it if you don’t want to install git.
I am just adding a link to the docs section (currently missing - ‘Documentation coming soon’) in case someone would be looking for more details in future