Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 135850f

Browse files
authored
Add Docker setup for running tools/format.sh. (#299)
1 parent 85fe74b commit 135850f

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

tools/docker-format/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:cosmic
2+
3+
RUN apt update && \
4+
apt install -y clang-format golang git python-pip && \
5+
go get -v github.com/bazelbuild/buildtools/buildifier && \
6+
pip install cmake_format
7+
8+
CMD ["/bin/bash"]

tools/docker-format/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Docker container for automatic formatting.
2+
3+
Usage:
4+
5+
```shell
6+
cd opencensus-cpp
7+
docker build --tag opencensus-cpp/format tools/docker-format
8+
docker run -v $PWD:/opencensus-cpp -it opencensus-cpp/format /opencensus-cpp/tools/docker-format/run.sh
9+
```

tools/docker-format/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export PATH=/root/go/bin:$PATH
3+
cd /opencensus-cpp
4+
tools/format.sh

0 commit comments

Comments
 (0)