Files
netris-nestri/warp.Dockerfile
Wanjohi 039cc96f3d feat: Add a separate image to build warp (#23)
## Description

**What(what issue does this code solve/what feature does it add):**
Build times for netris:server are way too long. so the idea is to move
warp into it's own container then build from there.
Later on first release we might drop this for a better solution.
**How(how does it solve it):**
1. Added the very own netris:warp

## Required Checklist:

- [x] I have added any necessary documentation and comments in my code
(where appropriate)
- [x] I have added tests to make sure my code runs in all contexts

## Further comments
2024-04-16 04:48:31 +03:00

14 lines
719 B
Docker

FROM rust:bookworm as builder
# Create a build directory and copy over all of the files
WORKDIR /build
COPY ./moq-server/ ./
# Reuse a cache between builds.
# I tried to `cargo install`, but it doesn't seem to work with workspaces.
# There's also issues with the cache mount since it builds into /usr/local/cargo/bin
# We can't mount that without clobbering cargo itself.
# We instead we build the binaries and copy them to the cargo bin directory.
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/build/target \
cargo build --manifest-path ./moq-pub/Cargo.toml --target x86_64-unknown-linux-gnu --release && cp target/x86_64-unknown-linux-gnu/release/moq-pub /usr/bin/warp