Skip to content

Build a Debian image #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .arg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ZWAVE_JS_VERSION=12.4.3
ZWAVE_JS_VERSION=12.4.4
ZWAVE_JS_SERVER_VERSION=1.34.0
28 changes: 5 additions & 23 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
VERSION 0.7

FROM alpine:3.18
FROM node:20-slim

WORKDIR /app

RUN apk add --no-cache \
nodejs=18.18.2-r0 \
tzdata
RUN apt-get update && apt-get upgrade -y

all:
BUILD \
Expand All @@ -22,40 +20,24 @@ test:
--platform=linux/arm64 \
+docker-test

build-deps:
RUN apk add --no-cache \
g++ \
git \
linux-headers \
make \
npm \
python3

build:
RUN npm config set \
fetch-retries 5 \
fetch-retry-mintimeout 100000 \
fetch-retry-maxtimeout 600000

build:
FROM +build-deps

ARG --required ZWAVE_JS_VERSION
ARG --required ZWAVE_JS_SERVER_VERSION
ARG ZWAVE_JS_PACKAGE=zwave-js@$ZWAVE_JS_VERSION
ARG ZWAVE_JS_SERVER_PACKAGE=@zwave-js/server@$ZWAVE_JS_SERVER_VERSION
ARG ZWAVE_JS_FLASH_PACKAGE=@zwave-js/flash@$ZWAVE_JS_VERSION
ARG NPM_INSTALL_EXTRA_FLAGS

# Prebuilt binaries for node serialport and Alpine are broken, so we
# rebuild from source:
# https://github.com/serialport/bindings-cpp/issues/139
# https://github.com/serialport/node-serialport/issues/2438
RUN npm install \
$NPM_INSTALL_EXTRA_FLAGS \
$ZWAVE_JS_SERVER_PACKAGE \
$ZWAVE_JS_FLASH_PACKAGE \
$ZWAVE_JS_PACKAGE \
&& npm rebuild --prefer-offline --build-from-source @serialport/bindings-cpp
$ZWAVE_JS_PACKAGE

SAVE ARTIFACT /app

Expand All @@ -70,7 +52,7 @@ docker:
/cache/db \
/logs

RUN apk add --no-cache \
RUN apt-get install -y \
tini

ARG EARTHLY_GIT_SHORT_HASH
Expand Down