Remove git dependency from Docker build via yarn resolution (#961)
Docker browser build fails because `@electron/rebuild` requires
`@electron/node-gyp` from a GitHub URL, which needs git to clone. The
package exists on npm registry but yarn.lock referenced the git URL.
## Changes
- **Added yarn resolution** to force
`@electron/node-gyp@10.2.0-electron.1` from npm registry instead of
GitHub
- **Removed git installation** from Dockerfile.browser builder stage
- **Updated yarn.lock** to resolve dependency from
`registry.yarnpkg.com` instead of `github.com`
```diff
// package.json
+ "resolutions": {
+ "@electron/node-gyp": "10.2.0-electron.1"
+ }
```
```diff
// Dockerfile.browser
- RUN apk add --no-cache git
```
This eliminates the git dependency entirely while preserving the exact
same package version.
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> build still fails
https://github.com/thomasnordquist/MQTT-Explorer/actions/runs/20443384267/job/58741359390
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
This commit is contained in:
@@ -4,9 +4,6 @@ FROM node:24-alpine AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Install git (required for git-based dependencies like @electron/node-gyp)
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Copy package files for dependency installation
|
||||
COPY package.json yarn.lock ./
|
||||
COPY app/package.json ./app/
|
||||
|
||||
@@ -46,6 +46,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/thomasnordquist/MQTT-Explorer.git"
|
||||
},
|
||||
"resolutions": {
|
||||
"@electron/node-gyp": "10.2.0-electron.1"
|
||||
},
|
||||
"build": {
|
||||
"appId": "mqtt-explorer",
|
||||
"productName": "MQTT Explorer",
|
||||
|
||||
@@ -667,9 +667,10 @@
|
||||
optionalDependencies:
|
||||
global-agent "^3.0.0"
|
||||
|
||||
"@electron/node-gyp@https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2":
|
||||
"@electron/node-gyp@10.2.0-electron.1", "@electron/node-gyp@https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2":
|
||||
version "10.2.0-electron.1"
|
||||
resolved "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2"
|
||||
resolved "https://registry.yarnpkg.com/@electron/node-gyp/-/node-gyp-10.2.0-electron.1.tgz#ca5f125dcd0ffb275797c0c418c0d64005e0f815"
|
||||
integrity sha512-YdpRE6qSNYyf7gBv1LBDc8OAs8f/mZthzM1k4pFzodNq8dBGf64MWC5Bq8VVlgdafjQXLpINHvtRAUC9uinoqw==
|
||||
dependencies:
|
||||
env-paths "^2.2.0"
|
||||
exponential-backoff "^3.1.1"
|
||||
|
||||
Reference in New Issue
Block a user