Optimized Docker images (#2966)

## Issue Addressed

Closes #2938

## Proposed Changes

* Build and publish images with a `-modern` suffix which enable CPU optimizations for modern hardware.
* Add docs for the plethora of available images!
* Unify all the Docker workflows in `docker.yml` (including for tagged releases).

## Additional Info

The `Dockerfile` is no longer used by our Docker Hub builds, as we use `cross` and a generic approach for ARM and x86. There's a new CI job `docker-build-from-source` which tests the `Dockerfile` without publishing anything.
This commit is contained in:
Michael Sproul
2022-01-31 22:55:03 +00:00
parent bdd70d7aef
commit 139b44342f
10 changed files with 187 additions and 186 deletions

View File

@@ -20,13 +20,13 @@ Additionally there is also a `-portable` suffix which indicates if the `portable
- Without `portable`: uses modern CPU instructions to provide the fastest signature verification times (may cause `Illegal instruction` error on older CPUs)
- With `portable`: approx. 20% slower, but should work on all modern 64-bit processors.
For details, see [Portability](#portability).
## Usage
Each binary is contained in a `.tar.gz` archive. For this example, lets assume the user needs
a portable `x86_64` binary.
> Whilst this example uses `v0.2.13` we recommend always using the latest release.
### Steps
1. Go to the [Releases](https://github.com/sigp/lighthouse/releases) page and
@@ -41,6 +41,19 @@ a portable `x86_64` binary.
> Windows users will need to execute the commands in Step 3 from PowerShell.
## Portability
Portable builds of Lighthouse are designed to run on the widest range of hardware possible, but
sacrifice the ability to make use of modern CPU instructions.
If you have a modern CPU then you should try running a non-portable build to get a 20-30% speed up.
* For **x86_64**, any CPU supporting the [ADX](https://en.wikipedia.org/wiki/Intel_ADX) instruction set
extension is compatible with the optimized build. This includes Intel Broadwell (2014)
and newer, and AMD Ryzen (2017) and newer.
* For **ARMv8**, most CPUs are compatible with the optimized build, including the Cortex-A72 used by
the Raspberry Pi 4.
## Troubleshooting
If you get a SIGILL (exit code 132), then your CPU is incompatible with the optimized build