diff --git a/docker-files/Dockerfile b/docker-files/Dockerfile index a316a3d..8d7a1ce 100644 --- a/docker-files/Dockerfile +++ b/docker-files/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.19 -ARG AKASA_ARCH="aarch64-unknown-linux-musl" -COPY bins/${AKASA_ARCH} /usr/local/bin/akasa +ARG TARGETARCH +COPY bins/$TARGETARCH /usr/local/bin/akasa diff --git a/docker-files/README.md b/docker-files/README.md index 159ffac..67ed405 100644 --- a/docker-files/README.md +++ b/docker-files/README.md @@ -11,6 +11,17 @@ docker run --init -it --rm -p 1883:1883 -v "$HOME/local/etc":/opt akasa:0.1.1 ak ``` ### The way to build the image: + +For multiple platforms: +``` +cp target/aarch64-unknown-linux-musl/release/akasa docker-files/bins/arm64 +cp target/x86_64-unknown-linux-musl/release/akasa docker-files/bins/amd64 + +docker buildx create --name multiarch --driver docker-container --platform linux/amd64,linux/arm64/v8 --use +docker buildx build --push --platform linux/amd64,linux/arm64/v8 --tag thewawar/akasa:0.1.1 . +``` + +Just for one platform: ```shell docker build -t akasa:0.1.1 . --build-arg AKASA_ARCH="aarch64-unknown-linux-musl" docker image tag akasa:0.1.1 thewawar/akasa:0.1.1