Skip to content

Commit

Permalink
Feat/dockerfile (#47)
Browse files Browse the repository at this point in the history
* feat: Add dockerfile to run librespeed-cli in a container.

* docs: Instructions to build and run container.
  • Loading branch information
dbrennand authored Jul 8, 2022
1 parent 954e973 commit c996e51
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
17 changes: 17 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit c996e51

Please sign in to comment.