Skip to content

Commit

Permalink
chore: support multi-platform docker
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWaWaR committed Dec 17, 2023
1 parent 6f9e2fa commit db83c04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-files/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions docker-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db83c04

Please sign in to comment.