diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-07-23 03:16:31 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-07-23 03:16:31 +0000 |
commit | dc272ef7e16ef274fb1f9439e2e16a33c9fe8db3 (patch) | |
tree | 9b4537b8353d0b22b6b44db128e4e9aadfc930ae | |
parent | Fix typo when getting tag name (diff) | |
download | miniserve-dc272ef7e16ef274fb1f9439e2e16a33c9fe8db3.tar.gz miniserve-dc272ef7e16ef274fb1f9439e2e16a33c9fe8db3.zip |
Fix and improve Docker build
Diffstat (limited to '')
-rw-r--r-- | Dockerfile | 7 | ||||
-rw-r--r-- | Makefile | 6 |
2 files changed, 6 insertions, 7 deletions
@@ -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 @@ -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 |