Initial Commit
This commit is contained in:
commit
c09b00ff35
30 changed files with 1930 additions and 0 deletions
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM rust:alpine AS builder
|
||||
|
||||
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo fetch
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV SQLX_OFFLINE=true
|
||||
|
||||
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
FROM scratch AS final
|
||||
|
||||
WORKDIR /
|
||||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/rboss /rboss
|
||||
|
||||
ENTRYPOINT ["/rboss"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue