mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
chore: update docker
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,17 +1,12 @@
|
||||
FROM alpine as builder
|
||||
ARG REPO VER TARGETPLATFORM
|
||||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
||||
TARGET="x86_64-unknown-linux-musl"; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
|
||||
TARGET="aarch64-unknown-linux-musl"; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/386" ]; then \
|
||||
TARGET="i686-unknown-linux-musl"; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
|
||||
TARGET="armv7-unknown-linux-musleabihf"; \
|
||||
fi && \
|
||||
wget https://github.com/${REPO}/releases/download/${VER}/dufs-${VER}-${TARGET}.tar.gz && \
|
||||
tar -xf dufs-${VER}-${TARGET}.tar.gz && \
|
||||
mv dufs /bin/
|
||||
FROM --platform=linux/amd64 messense/rust-musl-cross:x86_64-musl AS amd64
|
||||
COPY . .
|
||||
RUN cargo install --path . --root /
|
||||
|
||||
FROM --platform=linux/amd64 messense/rust-musl-cross:aarch64-musl AS arm64
|
||||
COPY . .
|
||||
RUN cargo install --path . --root /
|
||||
|
||||
FROM ${TARGETARCH} AS builder
|
||||
|
||||
FROM scratch
|
||||
COPY --from=builder /bin/dufs /bin/dufs
|
||||
|
||||
Reference in New Issue
Block a user