Skip to content

Commit d049a75

Browse files
committed
Add instructions for docker
1 parent e857065 commit d049a75

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,29 @@ Running the previous command wild also yield warnings along with the translation
1616

1717
Run `./scala-native-bindgen -help` to see all available options.
1818

19-
## Building
19+
## Obtaining bindgen
20+
21+
There are 2 ways to obtain bindgen:
22+
* [use docker container](#docker-container)
23+
* [build binary from sources](#building)
24+
25+
### Docker container
26+
This option requires [Docker].
27+
28+
Download docker image with the binary:
29+
```bash
30+
docker pull scalabindgen/scala-native-bindgen
31+
```
32+
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 --
36+
```
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.
38+
39+
[Docker]: https://www.docker.com/
40+
41+
### Building
2042

2143
Building this tool requires [CMake], [LLVM] and [Clang]. See the [Scala
2244
Native setup guide] for instructions on installing the dependencies.

0 commit comments

Comments
 (0)