fix perms & build based off of local, bound copy, not repo

This commit is contained in:
hosted-fornet 2024-09-24 08:34:05 -07:00
parent 89af14b893
commit d4d644d5f2

View File

@ -8,16 +8,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Clone the repository and prepare for build
WORKDIR /usr/src
RUN git clone https://github.com/kinode-dao/kinode.git
# Bind readonly & copy files in to avoid modifying host files
WORKDIR /usr/src/kinode
# Allow setting BRANCH_NAME at run time like
# `-e BRANCH_NAME=foo-bar`
ARG BRANCH=main
ENV BRANCH_NAME=$BRANCH
RUN git checkout $BRANCH_NAME
# Set the default command to run the build script
CMD ["/bin/bash", "-c", ". ~/.bashrc && . ~/.cargo/env && . $NVM_DIR/nvm.sh && ./scripts/build-release.py && cp -r /tmp/kinode-release/* /output"]
# TODO: once build is idempotent, remove the `rm -rf` line
CMD ["/bin/bash", "-c", ". ~/.bashrc && . ~/.cargo/env && . $NVM_DIR/nvm.sh && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit && ./scripts/build-release.py && cp -r /tmp/kinode-release/* /output && chmod 664 /output/* && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit"]