mirror of
https://github.com/icewind1991/clipboard-sync
synced 2026-06-03 10:24:06 +02:00
use two step dockerfile
This commit is contained in:
parent
7a0665eae9
commit
96295ac0dc
3 changed files with 15 additions and 11 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -1,6 +1,17 @@
|
|||
FROM ekidd/rust-musl-builder AS build
|
||||
|
||||
RUN sudo apt-get update && sudo apt-get install -y xorg-dev python3
|
||||
|
||||
# We need to add the source code to the image because `rust-musl-builder`
|
||||
# assumes a UID of 1000, but TravisCI has switched to 2000.
|
||||
ADD . ./
|
||||
RUN sudo chown -R rust:rust .
|
||||
|
||||
RUN cargo build --release --bin server
|
||||
|
||||
FROM scratch
|
||||
|
||||
ADD target/x86_64-unknown-linux-musl/release/server /
|
||||
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/server /
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["/server"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue