Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git/
.github/
.yarn/
node_modules/
.gitignore
.yarnrc.yml
package.json
yarn.lock
README.md
15 changes: 15 additions & 0 deletions .github/workflows/pipeline-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
# Keep this in sync with NODE_MAJOR in tools/install-deps.sh so the
# cached headers match the Node version installed in the images.
node-version: '22'
Comment thread
MarshallOfSound marked this conversation as resolved.
- name: Pre-populate node-gyp header cache
# Headers are platform/arch-independent (only Windows pulls an
# arch-specific node.lib), so it is safe to generate them on the amd64
# runner and COPY the result into every image.
run: |
corepack enable
yarn install --immutable
yarn node-gyp install --devdir "$PWD/.node-gyp-headers"
ls -la .node-gyp-headers
- name: Build and push Docker image
id: push
uses: mr-smithers-excellent/docker-build-push@19d2beefef6bcdc202195fdcb9deb79a4fab5c1f # v6.8
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.node-gyp-headers/
.yarn/install-state.gz
node_modules/
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.3.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enableScripts: false

nodeLinker: node-modules

npmMinimalAgeGate: 10080

npmPreapprovedPackages:
- "@electron/*"

yarnPath: .yarn/releases/yarn-4.10.3.cjs
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ RUN bash /tmp/install-deps.sh --32bit
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb

# Pre-populated node-gyp header cache (built on the host, see
# pipeline-docker-build.yml) so parallel `yarn install` postinstall builds in
# CI do not race downloading the same tarball. Left world-writable so node-gyp
# can still self-populate at runtime if the target Node version differs.
ENV npm_config_devdir=/opt/node-gyp-headers
COPY .node-gyp-headers /opt/node-gyp-headers
RUN chmod -R a+rwX /opt/node-gyp-headers

RUN rm -rf /var/lib/apt/lists/*

USER builduser
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile.devcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ RUN bash /tmp/install-deps.sh
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb

# Pre-populated node-gyp header cache (built on the host, see
# pipeline-docker-build.yml) so parallel `yarn install` postinstall builds in
# CI do not race downloading the same tarball. Left world-writable so node-gyp
# can still self-populate at runtime if the target Node version differs.
ENV npm_config_devdir=/opt/node-gyp-headers
COPY .node-gyp-headers /opt/node-gyp-headers
RUN chmod -R a+rwX /opt/node-gyp-headers

USER builduser
WORKDIR /home/builduser

Expand Down
8 changes: 8 additions & 0 deletions Dockerfile.tests.arm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ RUN bash /tmp/install-deps.sh --arm
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb

# Pre-populated node-gyp header cache (built on the host, see
# pipeline-docker-build.yml) so parallel `yarn install` postinstall builds in
# CI do not race downloading the same tarball. Left world-writable so node-gyp
# can still self-populate at runtime if the target Node version differs.
ENV npm_config_devdir=/opt/node-gyp-headers
COPY .node-gyp-headers /opt/node-gyp-headers
RUN chmod -R a+rwX /opt/node-gyp-headers

RUN rm -rf /var/lib/apt/lists/*

RUN sudo echo 'runner ALL=NOPASSWD: ALL' >> /etc/sudoers.d/60-runner
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@electron/build-images",
"private": true,
"description": "Docker containers used to build Electron on Linux",
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f",
"dependencies": {
"node-gyp": "12.2.0"
}
}
Loading
Loading