forked from rustformers/llm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rustformers#112 from katopz/main
Add Docker file
- Loading branch information
Showing
2 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Start with a rust alpine image | ||
FROM rust:alpine3.17 as builder | ||
# This is important, see https://github.com/rust-lang/docker-rust/issues/85 | ||
ENV RUSTFLAGS="-C target-feature=-crt-static" | ||
# if needed, add additional dependencies here | ||
RUN apk add --no-cache musl-dev | ||
# set the workdir and copy the source into it | ||
WORKDIR /app | ||
COPY ./ /app | ||
# do a release build | ||
RUN cargo build --release --bin llama-cli | ||
RUN strip target/release/llama-cli | ||
|
||
# use a plain alpine image, the alpine version needs to match the builder | ||
FROM alpine:3.17 | ||
# if needed, install additional dependencies here | ||
RUN apk add --no-cache libgcc | ||
# copy the binary into the final image | ||
COPY --from=builder /app/target/release/llama-cli . | ||
# set the binary as entrypoint | ||
ENTRYPOINT ["/llama-cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters