mirror of
https://github.com/svenstaro/miniserve
synced 2025-04-29 15:47:27 +08:00
Fix and improve Docker build
This commit is contained in:
parent
8ed9658edd
commit
dc272ef7e1
@ -1,11 +1,10 @@
|
||||
# This Dockerfile results in a super small container containing only the miniserve binary and nothing else.
|
||||
# Use this in case you don't need any additional tools in the container.
|
||||
FROM rustlang/rust:nightly as builder
|
||||
FROM rust as builder
|
||||
|
||||
ENV APP_HOME /usr/src/app/
|
||||
|
||||
RUN rustup default nightly-2020-07-20
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
RUN apt-get update && apt-get install -y upx musl-tools
|
||||
RUN apt update && apt-get install -y upx musl-tools
|
||||
|
||||
COPY . $APP_HOME
|
||||
WORKDIR $APP_HOME
|
||||
|
6
Makefile
6
Makefile
@ -13,16 +13,16 @@ endif
|
||||
build-linux:
|
||||
cargo build --target x86_64-unknown-linux-musl --release --locked
|
||||
strip target/x86_64-unknown-linux-musl/release/miniserve
|
||||
upx target/x86_64-unknown-linux-musl/release/miniserve
|
||||
upx --lzma target/x86_64-unknown-linux-musl/release/miniserve
|
||||
|
||||
.PHONY: build-win
|
||||
build-win:
|
||||
RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc" cargo build --target x86_64-pc-windows-gnu --release --locked
|
||||
strip target/x86_64-pc-windows-gnu/release/miniserve.exe
|
||||
upx target/x86_64-pc-windows-gnu/release/miniserve.exe
|
||||
upx --lzma target/x86_64-pc-windows-gnu/release/miniserve.exe
|
||||
|
||||
.PHONY: build-apple
|
||||
build-apple:
|
||||
cargo build --target x86_64-apple-darwin --release --locked
|
||||
strip target/x86_64-apple-darwin/release/miniserve
|
||||
upx target/x86_64-apple-darwin/release/miniserve
|
||||
upx --lzma target/x86_64-apple-darwin/release/miniserve
|
||||
|
Loading…
x
Reference in New Issue
Block a user