Skip to content

Commit

Permalink
docker compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Apr 30, 2024
1 parent c8f5043 commit a414dd2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.movement
.etc
target
28 changes: 28 additions & 0 deletions docker/build/monza-full-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 11 additions & 0 deletions docker/build/rd/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -101,6 +101,7 @@
in
with pkgs; {

# Monza Aptos
packages.monza-aptos = monza-aptos;

# Development Shell
Expand Down

0 comments on commit a414dd2

Please sign in to comment.