question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker build error:Error: spawn git ENOENT

See original GitHub issue

Describe 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: image 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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
brc-ddcommented, Sep 22, 2022

You have lastUpdated set to true. To use it you need git installed. Disable it if you don’t want to install git.

0reactions
popadicbranislavcommented, Nov 28, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found