-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathbuild.Dockerfile
30 lines (24 loc) · 1.11 KB
/
build.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# docker build -t lumen-builer -f build.Dockerfile .
# docker run --rm -v `pwd`/out:/out -it lumen-builder
FROM rust:latest
RUN apt -y update && apt install -y mingw-w64 zip jq
RUN rustup target add x86_64-pc-windows-gnu
COPY Cargo.toml /usr/src/lumen/Cargo.toml
COPY Cargo.lock /usr/src/lumen/Cargo.lock
COPY common /usr/src/lumen/common
COPY lumen /usr/src/lumen/lumen
WORKDIR /usr/src/lumen
RUN cargo fetch
RUN cargo build --release --target x86_64-unknown-linux-gnu && \
cargo build --release --target x86_64-pc-windows-gnu
COPY README.md /usr/src/lumen/
COPY LICENSE /usr/src/lumen/
COPY config-example.toml /usr/src/lumen/
VOLUME [ "/out" ]
CMD mkdir /tmp/out/ && \
cp README.md LICENSE config-example.toml /tmp/out/ && \
cp target/x86_64-unknown-linux-gnu/release/lumen /tmp/out/ && \
cp target/x86_64-pc-windows-gnu/release/lumen.exe /tmp/out/ && \
cd /tmp/out/ && \
tar czvf /out/lumen-x86_64-unknown-linux-gnu.tar.gz README.md LICENSE config-example.toml lumen && \
zip -9 /out/lumen-x86_64-pc-windows-gnu.zip README.md LICENSE config-example.toml lumen.exe