diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..e3decd47b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.movement +.etc +target \ No newline at end of file diff --git a/docker/build/monza-full-node/Dockerfile b/docker/build/monza-full-node/Dockerfile new file mode 100644 index 000000000..3158d12ef --- /dev/null +++ b/docker/build/monza-full-node/Dockerfile @@ -0,0 +1,28 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +WORKDIR /app + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/app"] \ No newline at end of file diff --git a/docker/build/rd/Dockerfile b/docker/build/rd/Dockerfile new file mode 100644 index 000000000..2d3672e0c --- /dev/null +++ b/docker/build/rd/Dockerfile @@ -0,0 +1,11 @@ +# Use the latest Nix image +FROM nixos/nix:latest + +# Set up working directory where the flake will be copied +WORKDIR /app + +# Copy the flake files into the container +COPY . /app + +# Set the entrypoint to use `nix develop` to execute commands within the Nix environment +ENTRYPOINT ["nix", "develop", "--command", "bash", "-c"] diff --git a/flake.nix b/flake.nix index eb7723144..68b3327ed 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ flake-utils, ... }: - flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-linux"] ( + flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-linux" "aarch64-linux"] ( system: let overlays = [(import rust-overlay)]; pkgs = import nixpkgs { @@ -101,6 +101,7 @@ in with pkgs; { + # Monza Aptos packages.monza-aptos = monza-aptos; # Development Shell