diff --git a/README.md b/README.md index 1654722..816c1cf 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For Linux users, you can use either the archive from golang.org, or install from ```shell script # pacman -S go ``` - + 2. Then, clone the repository: ```shell script @@ -59,10 +59,10 @@ can now proceed to build `librespeed-cli` with the build script: If you want to build for another operating system or system architecture, use the `GOOS` and `GOARCH` environment variables. Run `go tool dist list` to get a list of possible combinations of `GOOS` and `GOARCH`. - + Note: Technically, the CLI can be compiled with older Go versions that support Go modules, with `GO111MODULE=on` set. If you're compiling with an older Go runtime, you might have to change the Go version in `go.mod`. - + ```shell script # Let's say we're building for 64-bit Windows on Linux $ GOOS=windows GOARCH=amd64 ./build.sh @@ -74,7 +74,7 @@ can now proceed to build `librespeed-cli` with the build script: $ ls out librespeed-cli-windows-amd64.exe ``` - + 5. Now you can use the `librespeed-cli` and test your Internet speed! ## Install from AUR @@ -97,6 +97,26 @@ $ makepkg -si See the [librespeed-cli Homebrew tap](https://github.com/librespeed/homebrew-tap#setup). +## Container Image + +You can run `librespeed-cli` in a container. + +1. Build the container image: + + ```shell script + docker build -t librespeed-cli:latest . + ``` + +2. Run the container: + + ```shell script + docker run --rm --name librespeed-cli librespeed-cli:latest + # With options + docker run --rm --name librespeed-cli librespeed-cli:latest --telemetry-level disabled --no-upload + # To avoid "Failed to ping target host: socket: permission denied" errors when using --verbose + docker run --rm --name librespeed-cli --sysctl net.ipv4.ping_group_range="0 2147483647" librespeed-cli:latest --verbose + ``` + ## Usage You can see the full list of supported options with `librespeed-cli -h`: @@ -145,7 +165,7 @@ GLOBAL OPTIONS: multiple times. Cannot be used with --server --server-json value Use an alternative server list from remote JSON file --local-json value Use an alternative server list from local JSON file, - or read from stdin with "--local-json -". + or read from stdin with "--local-json -". --source SOURCE SOURCE IP address to bind to --timeout TIMEOUT HTTP TIMEOUT in seconds. (default: 15) --duration value Upload and download test duration in seconds (default: 15) @@ -153,7 +173,7 @@ GLOBAL OPTIONS: --upload-size value Size of payload being uploaded in KiB (default: 1024) --secure Use HTTPS instead of HTTP when communicating with LibreSpeed.org operated servers (default: false) - --skip-cert-verify Skip verifying SSL certificate for HTTPS connections (self-signed certs) (default: false) + --skip-cert-verify Skip verifying SSL certificate for HTTPS connections (self-signed certs) (default: false) --no-pre-allocate Do not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this @@ -205,7 +225,7 @@ As you can see in the example, all servers have their schemes defined. In case o `librespeed-cli` will use `http` by default, or `https` when the `--secure` option is enabled. ## Use a custom telemetry server -By default, the telemetry result will be sent to `librespeed.org`. You can also customize your telemetry settings +By default, the telemetry result will be sent to `librespeed.org`. You can also customize your telemetry settings via the `--telemetry` prefixed options. In order to load a custom telemetry endpoint configuration, you'll have to use the `--telemetry-json` option to specify a local JSON file containing the configuration bits. The format is as below: diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..11ae38d --- /dev/null +++ b/dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.17.7-buster as builder + +# Set working directory +WORKDIR /usr/src/librespeed-cli + +# Copy librespeed-cli +COPY . . + +# Build librespeed-cli +RUN ./build.sh + +FROM golang:1.17.7-buster + +# Copy librespeed-cli binary +COPY --from=builder /usr/src/librespeed-cli/out/librespeed-cli* /usr/src/librespeed-cli/librespeed-cli + +ENTRYPOINT ["/usr/src/librespeed-cli/librespeed-cli"]