🐳 Clang Tools Docker Image: This Docker image comes pre-installed with essential clang tools, including clang-format
and clang-tidy
.
You can access all available Clang Tools Docker images via Docker Hub registry or GitHub Packages registry.
all
(Supports versions of clang-tools includes19
,18
,17
,16
,15
,14
,13
,12
,11
,10
,9
)19
18
17
16
16-alpine
15
14
13
12
11
10
9
8
7
# Check clang-format version
$ docker run xianpengshen/clang-tools:17 clang-format --version
Ubuntu clang-format version 17.0.0 (+rc4-1~exp5ubuntu1)
# Format code (helloworld.c in the demo directory)
$ docker run -v $PWD:/src xianpengshen/clang-tools:17 clang-format --dry-run -i helloworld.c
# Check clang-tidy version
$ docker run xianpengshen/clang-tools:17 clang-tidy --version
Ubuntu LLVM version 17.0.0
Optimized build.
# Diagnostic code (helloworld.c in the demo directory)
$ docker run -v $PWD:/src xianpengshen/clang-tools:17 clang-tidy helloworld.c \
-checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-cplusplus-*,clang-analyzer-*,cppcoreguidelines-*
As base image in Dockerfile
FROM xianpengshen/clang-tools:17
WORKDIR /src
COPY . .
CMD [ "" ]
Then build and run the Docker image:
$ docker build -t clang-tools .
# Check clang-format version
$ docker run clang-tools clang-format --version
Ubuntu clang-format version 17.0.0 (+rc4-1~exp5ubuntu1)
# Format code
$ docker run clang-tools clang-format --dry-run -i helloworld.c
# Check clang-tidy version
$ docker run clang-tools clang-tidy --version
Ubuntu LLVM version 17.0.0
Optimized build.
# Diagnostic code
$ docker run clang-tools clang-tidy helloworld.c \
-checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-cplusplus-*,clang-analyzer-*,cppcoreguidelines-*
To provide feedback (requesting a feature or reporting a bug) please post to issues.