Skip to content

Commit

Permalink
Revise source build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Oct 17, 2024
1 parent 4b624b7 commit c67b9b7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/developers/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ There are two options buiding Nethermind from source code:

To build Nethermind from source, install [.NET SDK](https://dotnet.microsoft.com/en-us/download) 8 or later.

:::tip
For a seamless experience, ensure your .NET SDK is up to date.
:::

### Building

To build both the client and tests, run the following command from the project's root directory:
Expand Down Expand Up @@ -79,9 +83,9 @@ Currently, there are three Docker images available in the project's root directo
All Docker images have the following optional arguments:

- `BUILD_CONFIG`: the build configuration that is either `release` or `debug`. Defaults to `release`.
- `BUILD_TIMESTAMP`: the build timestamp as a Unix timestamp.
- `BUILD_TIMESTAMP`: the build time as a Unix timestamp. Defaults to the current time.
- `CI`: this is mostly used for CI builds determining whether the build is deterministic. Must be either `true` or `false`. Defaults to `false`.
- `COMMIT_HASH`: the Git commit hash to use for the build as a part of the version string.
- `COMMIT_HASH`: the Git commit hash to use as a part of the version string. Defaults to the latest commit hash.

Given the above, the following command builds the Nethermind chiseled Docker image from the project's root directory:

Expand Down
37 changes: 34 additions & 3 deletions versioned_docs/version-1.29.0/developers/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ There are two options buiding Nethermind from source code:

To build Nethermind from source, install [.NET SDK](https://dotnet.microsoft.com/en-us/download) 8 or later.

:::tip
For a seamless experience, ensure your .NET SDK is up to date.
:::

### Building

To build both the client and tests, run the following command from the project's root directory:
Expand Down Expand Up @@ -51,7 +55,7 @@ configuration only.

The build artifacts can be found in the `src/Nethermind/artifacts/bin/Nethermind.Runner/release` directory. By default, the logs and database directories are located here as well.

For more info, see [Running Nethermind](../get-started/running-node/running-node.md).
For more info, see [Running a node](../get-started/running-node/running-node.md).

#### Testing

Expand All @@ -70,10 +74,37 @@ dotnet test EthereumTests.sln -c release

## Bulding Docker image

To build Nethermind Docker image, run the following command from the project's root directory:
Currently, there are three Docker images available in the project's root directory:

- `Dockerfile`: the default Nethermind Docker image.
- `Dockerfile.chiseled`: the rootless and [chiseled](https://ubuntu.com/engage/chiselled-ubuntu-images-for-containers) version of the Nethermind Docker image.
- `Dockerfile.diag`: the diagnostics image with pre-installed .NET diagnostic and tracing tools. This image is intended for internal use and is not distributed via public channels.

All Docker images have the following optional arguments:

- `BUILD_CONFIG`: the build configuration that is either `release` or `debug`. Defaults to `release`.
- `BUILD_TIMESTAMP`: the build time as a Unix timestamp. Defaults to the current time.
- `CI`: this is mostly used for CI builds determining whether the build is deterministic. Must be either `true` or `false`. Defaults to `false`.
- `COMMIT_HASH`: the Git commit hash to use as a part of the version string. Defaults to the latest commit hash.

Given the above, the following command builds the Nethermind chiseled Docker image from the project's root directory:

```bash
build_timestamp=$(date '+%s')
commit_hash=$(git rev-parse HEAD)

docker build . \
-f Dockerfile.chiseled \
-t nethermind-chiseled \
--build-arg BUILD_TIMESTAMP=$build_timestamp \
--build-arg CI=true \
--build-arg COMMIT_HASH=$commit_hash
```

For quick testing images, the above arguments can be omitted if not needed:

```bash
docker build -t nethermind .
docker build . -t nethermind
```

For more info about running Docker containers,
Expand Down

0 comments on commit c67b9b7

Please sign in to comment.