Skip to content

Commit 66764d8

Browse files
authored
fix: install latest npm version for node 22 (#348)
* fix: install latest npm version for node 22 * fix: docker build configuration
1 parent 03fb07b commit 66764d8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
schedule:
55
- cron: "0 10 * * *" # everyday at 10am
66
workflow_dispatch:
7-
pull_request_target:
7+
pull_request:
88
branches: ["latest"]
99
push:
1010
branches: ["latest"]
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Check out the repo
2222
uses: actions/checkout@v5
23+
with:
24+
ref: ${{ github.head_ref || github.ref }}
2325
- name: Set imageName based on the repository name
2426
id: step_one
2527
run: |
@@ -46,5 +48,6 @@ jobs:
4648
with:
4749
platforms: ${{ env.platforms }}
4850
push: ${{ github.event_name != 'pull_request' }}
51+
pull: true
4952
tags: ${{ steps.docker_meta.outputs.tags }}
5053
labels: ${{ steps.docker_meta.outputs.labels }}

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ LABEL maintainer="[email protected]" \
1818
org.opencontainers.image.documentation="https://github.com/beevelop/docker-android-nodejs/blob/latest/README.md" \
1919
org.opencontainers.image.source="https://github.com/beevelop/docker-android-nodejs.git"
2020

21-
# Install Node.js using NodeSource repository
22-
RUN apt-get update && apt-get install -y curl ca-certificates && \
23-
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
24-
apt-get install -y nodejs && \
21+
# Install Node.js 22 with compatible npm using official Node.js binaries
22+
ENV NODE_VERSION=22.18.0
23+
RUN apt-get update && apt-get install -y curl ca-certificates xz-utils && \
24+
curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz | tar -xJ -C /usr/local --strip-components=1 && \
25+
npm install -g npm@latest && \
2526
npm install -g yarn && \
2627
apt-get clean && \
2728
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \

0 commit comments

Comments
 (0)