# syntax=docker/dockerfile:1 ARG DISTRIBUTION_VERSION ARG RUST_VERSION ARG XX_VERSION=latest FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-${DISTRIBUTION_VERSION} AS build-base COPY --from=xx / / SHELL [ "/bin/bash", "-c" ] ENV DEBIAN_FRONTEND=noninteractive # install host dependencies ARG DISTRIBUTION_PACKAGES RUN \ --mount=type=cache,target=/var/cache/apt,sharing=private \ --mount=type=cache,target=/var/lib/apt,sharing=private \ < debian/control Package: ${PACKAGE_NAME} Version: ${RELEASE_TAG_NAME} Conflicts: ${conflicts} Maintainer: Jakub Panek Architecture: ${_PACKAGE_ARCHITECTURE} Description: Lightning-fast and Powerful Code Editor Source: https://lapce.dev EOL depends=$(dpkg-shlibdeps -O -e usr/bin/lapce) depends=$(echo "${depends}" | sed 's/shlibs:Depends=//') echo "Depends: ${depends}" >> debian/control mv debian DEBIAN . /etc/os-release dpkg-deb --root-owner-group --build . "${OUTPUT_DIR}"/"${PACKAGE_NAME}.${ID}.${VERSION_CODENAME}.${_PACKAGE_ARCHITECTURE}.deb" EOF FROM build-base AS dev COPY . ./dev FROM scratch AS binary COPY --from=build /output/lapce . FROM scratch AS cross-binary COPY --from=build /output/lapce . FROM scratch AS package COPY --from=build /output/*.deb . FROM scratch AS cross-package COPY --from=build /output/*.deb .