Skip to content

Commit

Permalink
Added Dockerfile and building instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliusgrigaitis committed Mar 14, 2024
1 parent 6037d7f commit 03811c5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM rust:1.75.0-bullseye AS builder
RUN apt-get update && apt-get -y upgrade && apt-get install -y make libclang-dev
COPY . grandine
RUN cd grandine && ./scripts/build/release.sh

FROM ubuntu:latest
COPY --from=builder /usr/local/cargo/bin/grandine /usr/local/bin/grandine
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,57 @@ Then the build may take a few minutes:
git clone https://github.com/grandinetech/grandine
cd grandine
git submodule update --init
cargo build --release --features network-mainnet --features network-holesky --bin grandine
cargo build --release --features default-networks
```

The compiled binary is available at `./target/release/grandine`

### Cross-compilation

[Cross](https://github.com/cross-rs/cross) can be used for Grandine cross-compilation.

Cross-compilation command for `amd64` architecture:

```
cross build \
--bin grandine \
--target x86_64-unknown-linux-gnu \
--features default-networks \
--profile release
```

Cross-compilation command for `arm64` architecture:

```
cross build \
--bin grandine \
--target aarch64-unknown-linux-gnu \
--features default-networks \
--profile release
```

### Docker builds

Cross-compilated binaries can be used for Docker build images.

Docker build command for `amd64` architecture:

```
docker build \
--file Dockerfile.cross \
--platform linux/amd64 \
./target/x86_64-unknown-linux-gnu/release/
```

Docker buildx command for `arm64` architecture:

```
docker build \
--file Dockerfile.cross \
--platform linux/arm64 \
./target/aarch64-unknown-linux-gnu/release/
```

## Team

Grandine is built by [Grandine core team](https://grandine.io/) led by [Saulius Grigaitis](https://twitter.com/sauliuseth).
Expand Down

0 comments on commit 03811c5

Please sign in to comment.