Skip to content

Commit

Permalink
Dockerfile - improved caching!
Browse files Browse the repository at this point in the history
  • Loading branch information
gww-fuel committed Dec 21, 2023
1 parent 514e367 commit 6e8bcae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ FROM nixos/nix
# Set the working directory in the container
WORKDIR /usr/src/app

# Copy the current directory contents into the container at /usr/src/app
COPY . .
# For better cashing, first copy only files that maybe required
# for building nix environment.
COPY *.nix manifests patch script .

# Install the Fuel tools using Nix
RUN nix-channel --add https://nixos.org/channels/nixos-unstable nixos \
&& nix-channel --update \
&& nix --extra-experimental-features "nix-command flakes" build github:FuelLabs/fuel.nix#fuel
# Correct URL to repository is : https://github.com/FuelLabs/fuel.nix/

# Now, once we finished long, expensive nix building, we can
# copy over all contents of the current directory into the container at /usr/src/app
COPY . .

# Define environment variable for Nix
ENV ENV="/root/.nix-profile/etc/profile.d/nix.sh"

# Run a shell when the container launches
# CMD ["/bin/sh"]
CMD ["/bin/bash"]

0 comments on commit 6e8bcae

Please sign in to comment.