Skip to content

Commit f32b958

Browse files
immavallsjavaducky
andauthored
Fix docs that fail after the fix in v0.45.1 (#1284)
* fix docs that fail after the fix in v0.45.1 * add two commands examples: latest vs. concrete versions Co-authored-by: Paul Balogh <[email protected]>
1 parent fc7303e commit f32b958

File tree

1 file changed

+47
-14
lines changed

1 file changed

+47
-14
lines changed

src/data/markdown/docs/07 extensions/03 Guides/build-k6-using-docker.md

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,73 @@ Using the [xk6 Docker image](https://hub.docker.com/r/grafana/xk6/) can simplify
88

99
## Building your first extension
1010

11-
For example, to build a k6 v0.43.1 binary with the [`xk6-kafka`](https://github.com/mostafa/xk6-kafka) and [`xk6-output-influxdb`](https://github.com/grafana/xk6-output-influxdb) extensions, run one of the commands below, depending on your operating system:
11+
For example, to build a custom k6 binary with the latest versions of k6 and the [`xk6-kafka`](https://github.com/mostafa/xk6-kafka) and [`xk6-output-influxdb`](https://github.com/grafana/xk6-output-influxdb) extensions, run one of the commands below, depending on your operating system:
1212

1313
<CodeGroup labels={["Linux", "Mac", "Windows PowerShell", "Windows"]}>
1414

1515
```bash
16-
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.43.1 \
17-
--with github.com/mostafa/xk6-kafka@v0.17.0 \
18-
--with github.com/grafana/xk6-output-influxdb@v0.3.0
16+
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build \
17+
--with github.com/mostafa/xk6-kafka \
18+
--with github.com/grafana/xk6-output-influxdb
1919
```
2020

2121
```bash
2222
docker run --rm -e GOOS=darwin -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \
23-
grafana/xk6 build v0.43.1 \
24-
--with github.com/mostafa/xk6-kafka@v0.17.0 \
25-
--with github.com/grafana/xk6-output-influxdb@v0.3.0
23+
grafana/xk6 build \
24+
--with github.com/mostafa/xk6-kafka \
25+
--with github.com/grafana/xk6-output-influxdb
2626
```
2727

2828
```powershell
2929
docker run --rm -e GOOS=windows -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" `
30-
grafana/xk6 build v0.43.1 --output k6.exe `
31-
--with github.com/mostafa/xk6-kafka@v0.17.0 `
32-
--with github.com/grafana/xk6-output-influxdb@v0.3.0
30+
grafana/xk6 build --output k6.exe `
31+
--with github.com/mostafa/xk6-kafka `
32+
--with github.com/grafana/xk6-output-influxdb
3333
```
3434

3535
```batch
3636
docker run --rm -e GOOS=windows -v "%cd%:/xk6" ^
37-
grafana/xk6 build v0.43.1 --output k6.exe ^
38-
--with github.com/mostafa/xk6-kafka@v0.17.0 ^
39-
--with github.com/grafana/xk6-output-influxdb@v0.3.0
37+
grafana/xk6 build --output k6.exe ^
38+
--with github.com/mostafa/xk6-kafka ^
39+
--with github.com/grafana/xk6-output-influxdb
4040
```
4141

4242
</CodeGroup>
4343

44-
This creates a `k6` (or `k6.exe`) binary in the current working directory.
44+
This creates a `k6` (or `k6.exe`) binary in the current working directory.
45+
46+
To build the binary with concrete versions, see the example below (k6 `v0.45.1`, xk6-kafka `v0.19.1`, and xk6-output-influxdb `v0.4.1`):
47+
48+
<CodeGroup labels={["Linux", "Mac", "Windows PowerShell", "Windows"]}>
49+
50+
```bash
51+
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.45.1 \
52+
--with github.com/mostafa/[email protected] \
53+
--with github.com/grafana/[email protected]
54+
```
55+
56+
```bash
57+
docker run --rm -e GOOS=darwin -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \
58+
grafana/xk6 build v0.45.1 \
59+
--with github.com/mostafa/[email protected] \
60+
--with github.com/grafana/[email protected]
61+
```
62+
63+
```powershell
64+
docker run --rm -e GOOS=windows -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" `
65+
grafana/xk6 build v0.45.1 --output k6.exe `
66+
--with github.com/mostafa/[email protected] `
67+
--with github.com/grafana/[email protected]
68+
```
69+
70+
```batch
71+
docker run --rm -e GOOS=windows -v "%cd%:/xk6" ^
72+
grafana/xk6 build v0.45.1 --output k6.exe ^
73+
--with github.com/mostafa/[email protected] ^
74+
--with github.com/grafana/[email protected]
75+
```
76+
77+
</CodeGroup>
4578

4679
## Breaking down the command
4780

0 commit comments

Comments
 (0)