mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 09:16:46 +00:00
fix: Multi-arch upload
This commit is contained in:
parent
5bd174d287
commit
ffb4846239
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
# Ignore cargo build outputs
|
# Ignore build outputs
|
||||||
actix/target
|
actix/target
|
||||||
|
.docker
|
||||||
|
|
||||||
# Ignore SQLite file
|
# Ignore SQLite file
|
||||||
urls.sqlite
|
urls.sqlite
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM scratch
|
FROM scratch
|
||||||
ARG ARCH=linux/amd64
|
ARG TARGETARCH
|
||||||
|
|
||||||
COPY $ARCH/chhoto-url /chhoto-url
|
COPY .docker/$TARGETARCH/chhoto-url /chhoto-url
|
||||||
COPY ./resources /resources
|
COPY ./resources /resources
|
||||||
|
|
||||||
ENTRYPOINT ["/chhoto-url"]
|
ENTRYPOINT ["/chhoto-url"]
|
||||||
|
12
Makefile
12
Makefile
@ -1,18 +1,20 @@
|
|||||||
setup:
|
setup:
|
||||||
cargo install cross
|
cargo install cross
|
||||||
|
docker buildx create --use --platform=linux/arm64,linux/amd64 --name multi-platform-builder
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
|
||||||
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 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 linux/amd64 linux/arm64
|
mkdir -p .docker/amd64 .docker/arm64
|
||||||
cp actix/target/aarch64-unknown-linux-musl/release/chhoto-url linux/aarch64/
|
cp actix/target/aarch64-unknown-linux-musl/release/chhoto-url .docker/arm64/
|
||||||
cp actix/target/x86_64-unknown-linux-musl/release/chhoto-url linux/amd64/
|
cp actix/target/x86_64-unknown-linux-musl/release/chhoto-url .docker/amd64/
|
||||||
docker buildx -t chhoto-url --platform linux/amd64,linux/arm64,linux/arm/v7 .
|
docker buildx build --push --tag sintan1729/chhoto-url:dev --platform linux/amd64,linux/arm64 .
|
||||||
rm -rf linux
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cargo clean --manifest-path=actix/Cargo.toml
|
cargo clean --manifest-path=actix/Cargo.toml
|
||||||
|
rm -rf .docker
|
||||||
|
|
||||||
.PHONY: build clean docker
|
.PHONY: build clean docker
|
||||||
|
Loading…
Reference in New Issue
Block a user