From 78f6f88672fca92e8c43751cae51ca1a1278be2e Mon Sep 17 00:00:00 2001 From: Anton Belodedenko <2033996+ab77@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:09:05 -0700 Subject: [PATCH] revert to cli main --- cli/Dockerfile | 46 +++++++--------------------------------------- cli/package.json | 1 - 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index 9076826..92484ea 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18 AS base +FROM alpine:3.15.0@sha256:c74f1b1166784193ea6c8f9440263b9be6cae07dfe35e32a5df7a31358ac2060 AS base RUN apk add --update --no-cache \ nodejs~=16 \ @@ -9,55 +9,23 @@ RUN apk add --update --no-cache \ WORKDIR /root -RUN apk add --no-cache \ - bash \ - curl \ - docker-cli \ - jq \ - minicom \ - netcat-openbsd \ - openssh-client \ - qemu-img \ - qemu-system-x86_64 \ - unzip \ - wget \ - && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main \ - procmail - - -# --- build FROM base AS build -RUN apk add --no-cache -t .build-deps \ - build-base \ - git \ - linux-headers \ - python3 - -COPY run-tests.sh package*.json *.js ./ - -RUN npm i && apk del --purge .build-deps +# install npm in a separate build stage to save space in the runtime image +RUN apk add --update --no-cache npm +COPY package.json *.js ./ +RUN npm i -# --- runtime FROM base AS run -WORKDIR /data/ - COPY --from=build /root/ /root/ -COPY *.yml ./ - -COPY docker-hc balena.sh /usr/sbin/ - -RUN ln -sf /root/node_modules/balena-cli/bin/balena /usr/bin/balena - # create qemu-bridge-helper ACL file # https://wiki.qemu.org/Features/HelperNetworking RUN mkdir -p /etc/qemu \ && echo "allow all" > /etc/qemu/bridge.conf \ - && chmod 0640 /etc/qemu/bridge.conf \ - && addgroup root qemu \ - && addgroup root kvm + && chmod 0640 /etc/qemu/bridge.conf +WORKDIR /data/ CMD /root/cli.js diff --git a/cli/package.json b/cli/package.json index 5e681a3..3776d00 100644 --- a/cli/package.json +++ b/cli/package.json @@ -11,7 +11,6 @@ "author": "", "license": "ISC", "dependencies": { - "balena-cli": "^13.2.1", "mz": "^2.7.0", "yaml": "^1.10.2", "yargs": "^17.5.0"