tree-sitter-cli

Source

FROM stagex/pallet-rust AS build
COPY --from=stagex/core-make . /
ARG VERSION
ARG TARGETARCH
ADD fetch/tree-sitter-${VERSION}.tar.gz .
WORKDIR /tree-sitter-${VERSION}
RUN cargo fetch --locked
RUN --network=none <<-EOF
	make PREFIX=/usr
	make DESTDIR=/rootfs install
	install -vDm644 -t /rootfs/usr/share/licenses/tree-sitter LICENSE
	cargo build \
		--frozen \
		--release \
		--target "${ARCH}-unknown-linux-musl"
	mkdir -p /rootfs-cli/usr/bin
	cp target/${ARCH}-unknown-linux-musl/release/tree-sitter /rootfs-cli/usr/bin
	install -vDm644 -t /rootfs-cli/usr/share/licenses/tree-sitter LICENSE
EOF

FROM stagex/core-filesystem AS package-tree-sitter
COPY --from=build /rootfs /

FROM stagex/core-filesystem AS package-tree-sitter-cli
COPY --from=build /rootfs-cli /
Copied to clipboard!