diff --git a/Dockerfile b/Dockerfile index 2f1f5822..5496d4b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,22 @@ -FROM debian:12-slim AS downloader +FROM --platform=$BUILDPLATFORM alpine AS downloader_start ARG VERSION - +ARG TARGETARCH WORKDIR /tmp/download +RUN apk update && apk add unzip wget --no-cache -RUN apt-get update -RUN apt-get install unzip -y - +FROM downloader_start AS downloader_amd64 ADD "https://github.com/kinode-dao/kinode/releases/download/${VERSION}/kinode-x86_64-unknown-linux-gnu.zip" kinode-x86_64-unknown-linux-gnu.zip RUN unzip kinode-x86_64-unknown-linux-gnu.zip +FROM downloader_start AS downloader_arm64 +ADD "https://github.com/kinode-dao/kinode/releases/download/${VERSION}/kinode-aarch64-unknown-linux-gnu.zip" kinode-aarch64-unknown-linux-gnu.zip +RUN unzip kinode-aarch64-unknown-linux-gnu.zip + +FROM downloader_${TARGETARCH} AS downloader + FROM debian:12-slim -RUN apt-get update -RUN apt-get install openssl -y +RUN apt-get update && apt-get install openssl -y COPY --from=downloader /tmp/download/kinode /bin/kinode @@ -20,4 +24,4 @@ ENTRYPOINT [ "/bin/kinode" ] CMD [ "/kinode-home" ] EXPOSE 8080 -EXPOSE 9000 \ No newline at end of file +EXPOSE 9000 diff --git a/README.md b/README.md index c79b5e53..11464cb0 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,12 @@ To build a local Docker image, run the following command in this project root. ```bash # The `VERSION` may be replaced with the tag of a GitHub release -docker buildx build -t 0xlynett/kinode . --build-arg VERSION=v0.9.1 --platform linux/amd64,linux/arm64 + +# Build for your system's architecture +docker build . -t 0xlynett/kinode --build-arg VERSION=v0.9.1 + +# Build a multiarch image +docker buildx build . --platform arm64,amd64 --build-arg VERSION=v0.9.1 -t 0xlynett/kinode ``` For example: