This fork contains Valetudo-specific changes to the upstream pkg-fetch
Since space is limited in embedded devices, this fork is built with '--without-intl'
UPX is supported
Since the whole point of using pkg
is to have a binary that runs everywhere, we're doing static linking only.
Unless some Windows armv7 embedded machine magically appears somewhere, this will be linux-only.
-Os
This actually isn't a feature of this fork but just mainline pkg.
By setting the PKG_EXECPATH
environment variable to PKG_INVOKE_NODEJS
, the payload gets ignored and you'll end up
with the nodejs runtime which can then be used for other purposes
Fortunately, you can vendor your own pkg nodejs base binaries by using the PKG_CACHE_PATH
environment variable to point
to a directory that is part of your codebase. e.g. cross-env PKG_CACHE_PATH=./build_dependencies/pkg pkg --targets node16-linuxstatic-arm64 .
Building the docker images will also build the nodejs binary.
armv7
docker build -t valetudo-pkg-fetch-armv7 --build-arg HOST_ARCH=i686 --build-arg TARGET_TRIPLE=armv7l-linux-musleabihf --build-arg PKG_FETCH_OPTION_a=armv7 --build-arg PKG_FETCH_OPTION_n=node18 --build-arg PKG_FETCH_OPTION_p=linuxstatic -f .\Dockerfile.alpine .
aarch64
docker build -t valetudo-pkg-fetch-aarch64 --build-arg HOST_ARCH=x86_64 --build-arg TARGET_TRIPLE=aarch64-linux-musl --build-arg PKG_FETCH_OPTION_a=arm64 --build-arg PKG_FETCH_OPTION_n=node18 --build-arg PKG_FETCH_OPTION_p=linuxstatic -f .\Dockerfile.alpine .
docker create valetudo-pkg-fetch-armv7:latest
docker cp id_from_previous_command:/root/pkg-fetch/dist/ .