1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00

chg: Nicer multi-arch builds and also add armv7

This commit is contained in:
Sayantan Santra 2024-03-25 00:56:39 -05:00
parent 2baa481040
commit 82559d38fd
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
3 changed files with 17 additions and 12 deletions

View file

@ -1,8 +0,0 @@
FROM scratch
ARG TARGETARCH
COPY .docker/$TARGETARCH/chhoto-url /chhoto-url
COPY ./resources /resources
ENTRYPOINT ["/chhoto-url"]

View file

@ -0,0 +1,15 @@
FROM scratch as builder-amd64
COPY ./actix/target/x86_64-unknown-linux-musl/release/chhoto-url /chhoto-url
FROM scratch as builder-arm64
COPY ./actix/target/aarch64-unknown-linux-musl/release/chhoto-url /chhoto-url
FROM scratch as builder-arm
COPY ./actix/target/armv7-unknown-linux-musleabihf/release/chhoto-url /chhoto-url
ARG TARGETARCH
FROM builder-$TARGETARCH
COPY ./resources /resources
ENTRYPOINT ["/chhoto-url"]

View file

@ -5,13 +5,11 @@ setup:
build: build:
cross build --release --locked --manifest-path=actix/Cargo.toml --target aarch64-unknown-linux-musl cross build --release --locked --manifest-path=actix/Cargo.toml --target aarch64-unknown-linux-musl
cross build --release --locked --manifest-path=actix/Cargo.toml --target armv7-unknown-linux-musleabihf
cross build --release --locked --manifest-path=actix/Cargo.toml --target x86_64-unknown-linux-musl cross build --release --locked --manifest-path=actix/Cargo.toml --target x86_64-unknown-linux-musl
docker: build docker: build
mkdir -p .docker/amd64 .docker/arm64 docker buildx build --push --tag sintan1729/chhoto-url:dev --platform linux/amd64,linux/arm64,linux/arm/v7 .
cp actix/target/aarch64-unknown-linux-musl/release/chhoto-url .docker/arm64/
cp actix/target/x86_64-unknown-linux-musl/release/chhoto-url .docker/amd64/
docker buildx build --push --tag sintan1729/chhoto-url:dev --platform linux/amd64,linux/arm64 .
clean: clean:
cargo clean --manifest-path=actix/Cargo.toml cargo clean --manifest-path=actix/Cargo.toml