Example of building the Docker image using Nix inside Docker

This commit is contained in:
Daniël de Kok 2024-09-28 21:10:33 +02:00
parent 77a36d45eb
commit 755361b932
1 changed files with 13 additions and 0 deletions

13
Dockerfile.nix Normal file
View File

@ -0,0 +1,13 @@
# Build the image and get out the docker file:
#
# docker build -t tgi-nix -f Dockerfile.nix
# docker run --rm --volume $PWD/data:/data tgi-nix cp -H result /data/tgi-docker.tar.gz
# docker load < tgi-docker.tar.gz
FROM nixos/nix:2.18.8
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 .#dockerImage