diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..4d9b1a2
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+**
+!Dockerfile
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..d455fd3
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,20 @@
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: weekly
+ groups:
+ github-actions:
+ patterns: ['*']
+ - package-ecosystem: docker
+ directory: /
+ schedule:
+ interval: weekly
+ ignore:
+ # Node major versions are selected for each supported platform.
+ - dependency-name: node
+ update-types: ['version-update:semver-major']
+ groups:
+ docker:
+ patterns: ['*']
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index d205680..aef6ab4 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -1,67 +1,164 @@
name: Docker Image
on:
- schedule:
- - cron: "0 15 * * *" # everyday at 3pm
+ pull_request:
+ branches: [latest]
push:
- branches: ["**"]
- tags: ["v*.*.*"]
+ branches: [latest]
+ tags: ['v*.*.*']
+ schedule:
+ - cron: '0 15 * * *'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
- platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
+ IMAGE: beevelop/nodejs-python
jobs:
- main:
- runs-on: ubuntu-20.04
- timeout-minutes: 30
+ validate:
+ name: Validate (${{ matrix.platform }})
+ runs-on: ${{ matrix.runner }}
+ timeout-minutes: 20
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - platform: linux/amd64
+ runner: ubuntu-24.04
+ cache: amd64
+ node: '24'
+ python: '3.13'
+ - platform: linux/arm64
+ runner: ubuntu-24.04-arm
+ cache: arm64
+ node: '24'
+ python: '3.13'
+ - platform: linux/arm/v7
+ runner: ubuntu-24.04
+ cache: armv7
+ node: '22'
+ python: '3.11'
steps:
- - name: Check out the repo
- uses: actions/checkout@v2
- - name: Set imageName based on the repository name
- id: step_one
+ - name: Check out source
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Set up QEMU for 32-bit ARM
+ if: matrix.platform == 'linux/arm/v7'
+ uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
+ with:
+ platforms: arm
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
+ - name: Build test image
+ uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
+ with:
+ context: .
+ platforms: ${{ matrix.platform }}
+ tags: nodejs-python:smoke
+ load: true
+ cache-from: type=gha,scope=validate-${{ matrix.cache }}
+ cache-to: type=gha,scope=validate-${{ matrix.cache }},mode=min,ignore-error=true
+ no-cache-filters: ${{ github.event_name == 'schedule' && 'runtime' || '' }}
+ - name: Exercise Node.js and Python tooling
+ env:
+ PLATFORM: ${{ matrix.platform }}
+ NODE_MAJOR: ${{ matrix.node }}
+ PYTHON_MINOR: ${{ matrix.python }}
run: |
- imageName="${GITHUB_REPOSITORY/docker-/}"
- echo $imageName
- echo "imageName=$imageName" >> $GITHUB_ENV
- - name: Docker meta
- id: docker_meta
- uses: crazy-max/ghaction-docker-meta@v1
+ docker run --rm -i --network none --platform "$PLATFORM" \
+ -e NODE_MAJOR -e PYTHON_MINOR nodejs-python:smoke /bin/bash -eu <<'SH'
+ node -e 'if (process.versions.node.split(".")[0] !== process.env.NODE_MAJOR) process.exit(1)'
+ npm --version
+ npx --version
+ yarn --version
+ python - <<'PY'
+ import os
+ import sys
+ import sysconfig
+ from pathlib import Path
+
+ assert f"{sys.version_info.major}.{sys.version_info.minor}" == os.environ["PYTHON_MINOR"]
+ assert (Path(sysconfig.get_path("include")) / "Python.h").is_file()
+ PY
+ test "$(python --version)" = "$(python3 --version)"
+ python3 -m pip --version
+ pip --version
+ pip3 --version
+ python -m venv /tmp/venv
+ /tmp/venv/bin/python -m pip --version
+ virtualenv --no-download /tmp/virtualenv
+ /tmp/virtualenv/bin/python -m pip --version
+ SH
+
+ publish:
+ needs: validate
+ if: >-
+ github.actor != 'dependabot[bot]' &&
+ github.event_name != 'pull_request' &&
+ (github.ref == 'refs/heads/latest' ||
+ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')))
+ runs-on: ubuntu-24.04
+ timeout-minutes: 30
+ permissions:
+ contents: read
+ security-events: write
+ steps:
+ - name: Check out source
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Generate labels and tags
+ id: meta
+ uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
- images: ${{ env.imageName }}
+ images: ${{ env.IMAGE }}
+ tags: |
+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/latest' }}
+ type=schedule,pattern=nightly
+ type=ref,event=tag
- name: Set up QEMU
- uses: docker/setup-qemu-action@v1
+ uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
+ with:
+ platforms: arm64,arm
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
- - name: Login to Harbor
- uses: docker/login-action@v1
+ uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
+ - name: Log in to Docker Hub
+ uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Buildx cache
- uses: actions/cache@v1
- with:
- path: ${{ github.workspace }}/cache
- key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
- restore-keys: |
- ${{ runner.os }}-docker
- - name: Build and push
- id: docker_build
- uses: docker/build-push-action@v2
+ - name: Build and publish
+ id: build
+ uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
- platforms: ${{ env.platforms }}
- push: ${{ github.event_name != 'pull_request' }}
- tags: ${{ steps.docker_meta.outputs.tags }}
- labels: ${{ steps.docker_meta.outputs.labels }}
- cache-from: type=local,src=${{ github.workspace }}/cache
- cache-to: type=local,dest=${{ github.workspace }}/cache
- - name: Run Trivy vulnerability scanner
- uses: aquasecurity/trivy-action@master
+ context: .
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ push: true
+ sbom: true
+ provenance: mode=min
+ cache-from: |
+ type=gha,scope=validate-amd64
+ type=gha,scope=validate-arm64
+ type=gha,scope=validate-armv7
+ type=gha,scope=publish
+ cache-to: type=gha,scope=publish,mode=min,ignore-error=true
+ no-cache-filters: ${{ github.event_name == 'schedule' && 'runtime' || '' }}
+ - name: Scan the published digest
+ uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
- image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
- format: "template"
- template: "@/contrib/sarif.tpl"
- output: "trivy-results.sarif"
- - name: Upload Trivy scan results to GitHub Security tab
- uses: github/codeql-action/upload-sarif@v1
+ image-ref: ${{ env.IMAGE }}@${{ steps.build.outputs.digest }}
+ format: sarif
+ output: scan.sarif
+ - name: Upload scan results
+ uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
- sarif_file: "trivy-results.sarif"
+ sarif_file: scan.sarif
diff --git a/Dockerfile b/Dockerfile
index ac01746..721d770 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,35 @@
-FROM beevelop/nodejs
+# syntax=docker/dockerfile:1
+# check=error=true
+ARG TARGETARCH
-RUN apt-get update && \
- apt-get install -y python-is-python3 python3 python3-dev python3-pip python3-virtualenv && \
- rm -rf /var/lib/apt/lists/* && \
- python --version && \
- node -v && npm -v
\ No newline at end of file
+FROM node:24.23.0-trixie-slim@sha256:83079001d4ca6bf276035aa1c7b819b9542fc87a858a4fdc52ccc014bbf92143 AS node-24
+FROM node-24 AS node-amd64
+FROM node-24 AS node-arm64
+# Use Node 22 Bookworm where the official Node 24 images omit arm/v7.
+FROM node:22.23.5-bookworm-slim@sha256:be979e5523c76fa4d5ca4ebd3099078f220aa47ec39c48ad5b5df9314debd6eb AS node-arm
+
+FROM node-${TARGETARCH} AS runtime
+
+LABEL org.opencontainers.image.title="Beevelop Node.js and Python" \
+ org.opencontainers.image.description="Node.js, npm, Yarn Classic, and Debian Python tooling" \
+ org.opencontainers.image.source="https://github.com/beevelop/docker-nodejs-python" \
+ org.opencontainers.image.licenses="MIT"
+
+RUN apt-get update \
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ ca-certificates \
+ curl \
+ gnupg \
+ lsb-release \
+ python-is-python3 \
+ python3 \
+ python3-dev \
+ python3-pip \
+ python3-venv \
+ python3-virtualenv \
+ && rm -rf /var/lib/apt/lists/*
+
+ENV TERM=xterm
+
+ENTRYPOINT []
+CMD ["/bin/bash"]
diff --git a/README.md b/README.md
index 4a73996..d25bf62 100644
--- a/README.md
+++ b/README.md
@@ -1,42 +1,63 @@
-
-
-
-
-
-[](https://github.com/beevelop/docker-nodejs-python/releases)
-
-
-[](https://beevelop.com)
-
-# Node.js with Python based on [beevelop/nodejs](https://github.com/beevelop/docker-nodejs)
-
-- npm: `6.14.12`
-- Node: `v14.16.1`
-- Python: `3.8.5`
-
-### Pull, build or run this image
-```bash
-# pull the most recent tag / release
-docker pull beevelop/nodejs-python:v2021.06.1
-
-# or run the image interactively
-docker run --rm --name beevelop -it beevelop/nodejs-python:v2021.06.1 bash
-
-# or build the image from GitHub
-docker build -t beevelop/nodejs-python github.com/beevelop/docker-base
+[](https://github.com/beevelop/docker-nodejs-python/actions/workflows/docker.yml)
+[](https://hub.docker.com/r/beevelop/nodejs-python)
+[](https://github.com/beevelop/docker-nodejs-python/releases)
+
+# Node.js and Python in Docker
+
+Use Node.js, npm, Yarn Classic, and Python in the same build environment. The image includes `python`, `python3`, `pip`, `pip3`, `venv`, `virtualenv`, and Python development headers.
+
+| Platform | Base | Node.js | Python |
+| --- | --- | --- | --- |
+| `linux/amd64`, `linux/arm64` | Debian 13 (Trixie) slim | 24 LTS | 3.13 |
+| `linux/arm/v7` | Debian 12 (Bookworm) slim | 22 LTS | 3.11 |
+
+The 32-bit ARM build uses the maintained Node.js 22 Docker Official Image. Node.js 22 is scheduled to reach end of life on April 30, 2027. Plan to move ARM builds to `linux/arm64` before then. [Node.js image platforms](https://github.com/nodejs/docker-node/blob/main/versions.json) ยท [Node.js release schedule](https://github.com/nodejs/Release/blob/main/schedule.json)
+
+## Use the image
+
+```sh
+docker pull beevelop/nodejs-python:latest
+docker run --rm -it beevelop/nodejs-python:latest
```
-### Or use as base image
-```Dockerfile
-FROM beevelop/nodejs-python:v2021.06.1
+The default command opens Bash and uses the root account so derived build images can install system packages. The upstream image also provides a `node` account for commands that do not need root.
+
+When upgrading an older image based on Ubuntu, check OS package names and rebuild dependencies with native Node.js or Python extensions. Debian manages system Python packages under [PEP 668](https://peps.python.org/pep-0668/). Install application dependencies in a virtual environment using `python -m venv .venv` and `.venv/bin/python -m pip install -r requirements.txt`.
+
+For repeatable builds, pin a CalVer tag (`vYYYY.MM.MICRO`) or a digest from [Docker Hub tags](https://hub.docker.com/r/beevelop/nodejs-python/tags).
+
+## Build and verify locally
+
+From the cloned repository:
+
+```sh
+docker buildx build --load -t nodejs-python:local .
+docker run --rm nodejs-python:local bash -ec 'node --version; npm --version; yarn --version; python --version; python -m venv /tmp/venv; /tmp/venv/bin/python -m pip --version'
```
----
+Set `--platform linux/arm/v7` on both commands to verify the 32-bit ARM image on a machine configured for that architecture or emulation.
+
+## Publishing
+
+Pull requests build and smoke-test all three platforms. Successful workflows on `latest` publish `latest`; version tags publish that release tag and `latest`. The daily scheduled rebuild refreshes `nightly` and `latest` with current Debian packages. Published images include an SBOM, provenance attestation, and a vulnerability scan linked to the published digest.
-
+## All Docker images
----
+| Badge | Docker Hub | Build Status | Published | Release / Tag | License |
+| --- | --- | --- | --- | --- | --- |
+| [](https://github.com/beevelop/docker-base) | [](https://hub.docker.com/r/beevelop/base)
[](https://hub.docker.com/r/beevelop/base)
[](https://hub.docker.com/r/beevelop/base/tags?name=latest) | [](https://github.com/beevelop/docker-base/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-base/releases/latest) | [](https://github.com/beevelop/docker-base/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-base/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-java) | [](https://hub.docker.com/r/beevelop/java)
[](https://hub.docker.com/r/beevelop/java)
[](https://hub.docker.com/r/beevelop/java/tags?name=latest) | [](https://github.com/beevelop/docker-java/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-java/releases/latest) | [](https://github.com/beevelop/docker-java/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-java/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-android) | [](https://hub.docker.com/r/beevelop/android)
[](https://hub.docker.com/r/beevelop/android)
[](https://hub.docker.com/r/beevelop/android/tags?name=latest) | [](https://github.com/beevelop/docker-android/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-android/releases/latest) | [](https://github.com/beevelop/docker-android/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-android/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-android-nodejs) | [](https://hub.docker.com/r/beevelop/android-nodejs)
[](https://hub.docker.com/r/beevelop/android-nodejs)
[](https://hub.docker.com/r/beevelop/android-nodejs/tags?name=latest) | [](https://github.com/beevelop/docker-android-nodejs/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-android-nodejs/releases/latest) | [](https://github.com/beevelop/docker-android-nodejs/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-android-nodejs/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-cordova) | [](https://hub.docker.com/r/beevelop/cordova)
[](https://hub.docker.com/r/beevelop/cordova)
[](https://hub.docker.com/r/beevelop/cordova/tags?name=latest) | [](https://github.com/beevelop/docker-cordova/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-cordova/releases/latest) | [](https://github.com/beevelop/docker-cordova/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-cordova/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-ionic) | [](https://hub.docker.com/r/beevelop/ionic)
[](https://hub.docker.com/r/beevelop/ionic)
[](https://hub.docker.com/r/beevelop/ionic/tags?name=latest) | [](https://github.com/beevelop/docker-ionic/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-ionic/releases/latest) | [](https://github.com/beevelop/docker-ionic/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-ionic/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-nginx-basic-auth) | [](https://hub.docker.com/r/beevelop/nginx-basic-auth)
[](https://hub.docker.com/r/beevelop/nginx-basic-auth)
[](https://hub.docker.com/r/beevelop/nginx-basic-auth/tags?name=latest) | [](https://github.com/beevelop/docker-nginx-basic-auth/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-nginx-basic-auth/releases/latest) | [](https://github.com/beevelop/docker-nginx-basic-auth/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-nginx-basic-auth/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-claude) | [](https://hub.docker.com/r/beevelop/claude)
[](https://hub.docker.com/r/beevelop/claude)
[](https://hub.docker.com/r/beevelop/claude/tags?name=latest) | [](https://github.com/beevelop/docker-claude/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-claude/releases/latest) | [](https://github.com/beevelop/docker-claude/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-claude/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-nodejs) | [](https://hub.docker.com/r/beevelop/nodejs)
[](https://hub.docker.com/r/beevelop/nodejs)
[](https://hub.docker.com/r/beevelop/nodejs/tags?name=latest) | [](https://github.com/beevelop/docker-nodejs/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-nodejs/releases/latest) | [](https://github.com/beevelop/docker-nodejs/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-nodejs/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-nodejs-python) | [](https://hub.docker.com/r/beevelop/nodejs-python)
[](https://hub.docker.com/r/beevelop/nodejs-python)
[](https://hub.docker.com/r/beevelop/nodejs-python/tags?name=latest) | [](https://github.com/beevelop/docker-nodejs-python/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-nodejs-python/releases/latest) | [](https://github.com/beevelop/docker-nodejs-python/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-nodejs-python/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-uniqush) | [](https://hub.docker.com/r/beevelop/uniqush)
[](https://hub.docker.com/r/beevelop/uniqush)
[](https://hub.docker.com/r/beevelop/uniqush/tags?name=latest) | [](https://github.com/beevelop/docker-uniqush/actions/workflows/docker.yml) | [](https://github.com/beevelop/docker-uniqush/releases/latest) | [](https://github.com/beevelop/docker-uniqush/releases/latest)
[](https://calver.org/) | [](https://github.com/beevelop/docker-uniqush/blob/latest/LICENSE) |
+| [](https://github.com/beevelop/docker-shields) | [](https://hub.docker.com/r/beevelop/shields)
[](https://hub.docker.com/r/beevelop/shields)
[](https://hub.docker.com/r/beevelop/shields/tags?name=latest) | [](https://github.com/beevelop/docker-shields/actions/workflows/docker.yml) | [](https://hub.docker.com/r/beevelop/shields/tags) | [](https://hub.docker.com/r/beevelop/shields/tags?name=latest) | [](https://github.com/badges/shields/blob/master/LICENSE-APACHE) |
-### Use tags where possible, because...
+### Use tags where possible, because
-
\ No newline at end of file
+