Skip to content

Conversation

@r3dlobst3r
Copy link

Updated Dockerfile and CI workflows to support multi-platform builds (AMD64 and ARM64) while resolving npm dependency compatibility issues.

Changes

  • Updated Node.js from 16.3.0 to latest 16.x (16.20.2)
  • Changed runtime stage from bare Alpine to node:16-alpine base image
  • Added multi-platform build support to all GitHub Actions workflows
  • Removed redundant nodejs installation in runtime stage

Technical Details

The original Dockerfile used Node.js 16.3.0 in the builder stage but installed an older Node.js version from Alpine 3.13 packages in the runtime stage. This caused compatibility issues with newer npm dependencies that require modern JavaScript features:

  • Object.hasOwn() (added in Node.js 16.9.0)
  • Logical OR assignment operator ||= (ES2021, Node.js 15.0.0+)

Newer versions of winston and its transitive dependencies (@dabh/diagnostics, @so-ric/colorspace) now use these features, causing runtime failures on older Node.js versions.

Testing

  • Built Docker image on ARM64 architecture (Apple Silicon)
  • Verified image architecture: arm64
  • Successfully ran container and confirmed application startup
  • Application entered setup mode as expected (no config provided)
  • No JavaScript syntax errors encountered

CI/CD Changes

All three workflow files updated to build multi-platform images:

  • docker-master.yml (master branch)
  • docker-preview.yml (preview branch)
  • docker.yml (dev branch)

Added QEMU and Docker Buildx setup to enable cross-platform builds. Images will now be available for both linux/amd64 and linux/arm64.

Updated Dockerfile and CI workflows to support multi-platform builds
(AMD64 and ARM64) while resolving npm dependency compatibility issues.

Changes:
- Updated Node.js from 16.3.0 to latest 16.x (16.20.2)
- Changed runtime stage from bare Alpine to node:16-alpine base image
- Added multi-platform build support to all GitHub Actions workflows
- Removed redundant nodejs installation in runtime stage

Technical Details:
The original Dockerfile used Node.js 16.3.0 in the builder stage but
installed an older Node.js version from Alpine 3.13 packages in the
runtime stage. This caused compatibility issues with newer npm
dependencies that require modern JavaScript features:

- Object.hasOwn() (added in Node.js 16.9.0)
- Logical OR assignment operator ||= (ES2021, Node.js 15.0.0+)

Newer versions of winston and its transitive dependencies
(@dabh/diagnostics, @so-ric/colorspace) now use these features,
causing runtime failures on older Node.js versions.

Testing:
- Built Docker image on ARM64 architecture (Apple Silicon)
- Verified image architecture: arm64
- Successfully ran container and confirmed application startup
- Application entered setup mode as expected (no config provided)
- No JavaScript syntax errors encountered

CI/CD Changes:
All three workflow files updated to build multi-platform images:
- docker-master.yml (master branch)
- docker-preview.yml (preview branch)
- docker.yml (dev branch)

Added QEMU and Docker Buildx setup to enable cross-platform builds.
Images will now be available for both linux/amd64 and linux/arm64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant