Open Windfisch opened 1 month ago
Make sure you're using node14 node18. Also might be best to compile it in a dev environment inside a docker container.
The Dockerfile doesn't work because there isn't currently a way to run headless without hackery, the entire process is wrapped in an electron app.
I also know there are several prebuild and postbuild scripts that you have to run.
I realized I didn't give you much information. Here is a Dockerfile I just made that builds and exports the built files back into your local directory.
ARG version=v1.4.9
FROM node:18-bullseye AS build-stage
WORKDIR /build
# Clone the repository
RUN git clone https://github.com/Sienci-Labs/gsender.git . && \
git checkout ${version}
# Install dependencies
RUN yarn prepare && yarn install
# Build the project
RUN yarn prebuild-latest && yarn lint && yarn build
FROM scratch AS artifact
#Copy the built files from the build stage to the --output directory
COPY --from=build-stage /build/dist /dist
COPY --from=build-stage /build/bin /bin
# This will dump the build and the bin directories out into the folder with the Dockerfile.
# You can then run these commands to get it running outside of a container
# After build, I tested it running on Node 21.6.2 as of writing this.
# yarn --cwd dist/gsender install
# npm install electron --prefix dist/gsender
# ./bin/gsender
This can be successfully built using this command:
DOCKER_BUILDKIT=1 docker build --target artifact --output . .
Result:
This will dump the build and the bin directories out into the folder with the Dockerfile.
You can then run these commands to get it running outside of a container
yarn --cwd dist/gsender install
npm install electron --prefix dist/gsender
./bin/gsender
After build, I tested it running on Node 21.6.2 as of writing this. and it runs headless
NO AI WAS USED IN WRITING THIS
And here is a Dockerfile that will run it headless. Keep in mind that to test this you have to mount the device into the container also mount the files that save your settings or nothing will work. But this should get you started.
Because we are not exporting the files buildx is not needed
docker build .
ARG version=v1.4.9
FROM node:18-bullseye AS build-stage
WORKDIR /build
# Clone the repository
RUN git clone https://github.com/Sienci-Labs/gsender.git . && \
git checkout ${version}
# Install dependencies
RUN yarn prepare && yarn install
# Build the project
RUN yarn prebuild-latest && yarn lint && yarn build
FROM node:22-bullseye AS run-stage
# Install udev
RUN apt update -y && \
apt upgrade -y && \
apt install udev -y
WORKDIR /app
#Copy the built files from the build stage to run stage
COPY --from=build-stage /build/dist /app/dist
COPY --from=build-stage /build/bin /app/bin
WORKDIR /app/dist/gsender
RUN yarn install && npm install electron
ENTRYPOINT ["/app/bin/gsender"]
Result: and the console output on run: and the url:
I HAVE NOT tested this or connected it to my machine to test further, but it builds and runs in, and out of a docker container.
Good luck.
When I try to compile this repo, the
yarn install
step fails with the following:This happens with Arch Linux, Debian stable and alpine:latest.
Additionally, the Docker file does not work. Also,
npm install
instantly fails on latestmain
withERESOLVE
.What's the expected build environment and how to build this software?