Skip to content

Commit 489074d

Browse files
committed
Improve documentation on how to use the dockerized bindgen
1 parent f600dcb commit 489074d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,32 @@ There are 2 ways to obtain bindgen:
2323
* [build binary from sources](#building)
2424

2525
### Docker container
26+
2627
This option requires [Docker].
2728

2829
Download docker image with the binary:
29-
```bash
30+
31+
```sh
3032
docker pull scalabindgen/scala-native-bindgen
3133
```
3234

33-
Mount directory with needed header file and run bindgen:
34-
```bash
35-
docker run --entrypoint=scala-native-bindgen -v /path/to/header:/src --rm scalabindgen/scala-native-bindgen /src/my_header.h --name my_header --
35+
Mount directories with required header files and run bindgen:
36+
37+
```sh
38+
docker run -v "$(pwd)":/src -v /usr/include:/usr/include \
39+
--rm scalabindgen/scala-native-bindgen \
40+
relative/path/to/my_header.h --name my_header --
3641
```
37-
The docker image does not contain standard headers. Add `-v /usr/include:/usr/include` option to use headers from `/usr/include` in a container.
42+
43+
The docker image does not contain standard headers so it is important to
44+
mount all system include directories that are used by the header file
45+
passed to `scala-native-bindgen`. See the [docker-bindgen.sh] script for
46+
how to wrap the dockerized program. The `$CWD` of the container is
47+
`/src` which should be mounted from `$(pwd)` in case relative paths are
48+
used.
3849

3950
[Docker]: https://www.docker.com/
51+
[docker-bindgen.sh]: scripts/docker-bindgen.sh
4052

4153
### Building
4254

0 commit comments

Comments
 (0)