Skip to content

Commit c996e51

Browse files
authored
Feat/dockerfile (#47)
* feat: Add dockerfile to run librespeed-cli in a container. * docs: Instructions to build and run container.
1 parent 954e973 commit c996e51

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,26 @@ $ makepkg -si
9797

9898
See the [librespeed-cli Homebrew tap](https://github.com/librespeed/homebrew-tap#setup).
9999

100+
## Container Image
101+
102+
You can run `librespeed-cli` in a container.
103+
104+
1. Build the container image:
105+
106+
```shell script
107+
docker build -t librespeed-cli:latest .
108+
```
109+
110+
2. Run the container:
111+
112+
```shell script
113+
docker run --rm --name librespeed-cli librespeed-cli:latest
114+
# With options
115+
docker run --rm --name librespeed-cli librespeed-cli:latest --telemetry-level disabled --no-upload
116+
# To avoid "Failed to ping target host: socket: permission denied" errors when using --verbose
117+
docker run --rm --name librespeed-cli --sysctl net.ipv4.ping_group_range="0 2147483647" librespeed-cli:latest --verbose
118+
```
119+
100120
## Usage
101121

102122
You can see the full list of supported options with `librespeed-cli -h`:

dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM golang:1.17.7-buster as builder
2+
3+
# Set working directory
4+
WORKDIR /usr/src/librespeed-cli
5+
6+
# Copy librespeed-cli
7+
COPY . .
8+
9+
# Build librespeed-cli
10+
RUN ./build.sh
11+
12+
FROM golang:1.17.7-buster
13+
14+
# Copy librespeed-cli binary
15+
COPY --from=builder /usr/src/librespeed-cli/out/librespeed-cli* /usr/src/librespeed-cli/librespeed-cli
16+
17+
ENTRYPOINT ["/usr/src/librespeed-cli/librespeed-cli"]

0 commit comments

Comments
 (0)