From 7cb6abdf2f8249bcdb58facc37ef997f28838307 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 30 Sep 2024 09:53:16 +0200 Subject: [PATCH] Other dockerfile. --- .dockerignore | 1 + Dockerfile.nix | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 1c641e7a..0b495924 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,4 @@ server/transformers server/flash-attention cmake-build-debug/ cmake-build-release/ +Dockerfile* diff --git a/Dockerfile.nix b/Dockerfile.nix index 4b58dcf3..f1e7e0f5 100644 --- a/Dockerfile.nix +++ b/Dockerfile.nix @@ -3,11 +3,22 @@ # docker build -t tgi-nix-builder -f Dockerfile.nix # docker run --log-driver=none tgi-nix-builder | docker load -FROM nixos/nix:2.18.8 +FROM nixos/nix:2.18.8 AS builder RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf RUN nix profile install nixpkgs#cachix RUN cachix use text-generation-inference WORKDIR /root ADD . . -RUN nix build .#dockerImageStreamed -ENTRYPOINT ./result +RUN nix build . +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +FROM ubuntu:24.04 + +WORKDIR /app + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /root/result /app +RUN ldconfig +CMD ["ldconfig", "/app/bin/text-generation-launcher"]