Skip to content

Commit

Permalink
Merge pull request #21 from shenxianpeng/update-clang-tools-all
Browse files Browse the repository at this point in the history
#20 Update supported versions in clang-tools:all
  • Loading branch information
shenxianpeng authored Mar 27, 2022
2 parents 4396f09 + 92f308c commit 41fe38e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Supported tags

* [clang-tools:all](https://github.com/shenxianpeng/clang-tools/blob/master/all/Dockerfile) (supports all versions of the below tags)
* [clang-tools:all](https://github.com/shenxianpeng/clang-tools/blob/master/all/Dockerfile) (Include tags `14`, `13`, **`12`**(default), `11`, `10`, `9`, `8`)
* [clang-tools:14](https://github.com/shenxianpeng/clang-tools/blob/master/14/Dockerfile)
* [clang-tools:13](https://github.com/shenxianpeng/clang-tools/blob/master/13/Dockerfile)
* [clang-tools:12-alpine-edge](https://github.com/shenxianpeng/clang-tools/blob/master/12/alpine-edge/Dockerfile)
Expand Down
21 changes: 17 additions & 4 deletions all/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM ubuntu:20.04

ARG DEFAULT_VERSION=12
ENV VERSION="12 11 10 9 8 7 6.0"
ENV VERSIONS="12 11 10 9 8"
ENV CLANG13="clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04"
ENV CLANG13_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/${CLANG13}.tar.xz"
ENV CLANG14="clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04"
ENV CLANG14_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/${CLANG14}.tar.xz"

RUN apt-get update \
&& for i in ${VERSION}; do \
tools="clang-format-$i clang-tidy-$i"; \
apt-get -y install $tools; done \
&& apt-get install -y xz-utils wget \
&& for VERSION in ${VERSIONS}; do \
apt-get -y install clang-format-$VERSION clang-tidy-$VERSION; done \
&& wget --no-verbose $CLANG13_URL \
&& tar -xvf $CLANG13.tar.xz \
&& cp $CLANG13/bin/clang-format /usr/bin/clang-format-13 \
&& cp $CLANG13/bin/clang-tidy /usr/bin/clang-tidy-13 \
&& wget --no-verbose $CLANG14_URL \
&& tar -xvf $CLANG14.tar.xz --no-same-owner\
&& cp $CLANG14/bin/clang-format /usr/bin/clang-format-14 \
&& cp $CLANG14/bin/clang-tidy /usr/bin/clang-tidy-14 \
&& rm -rf $CLANG13 $CLANG13.tar.xz $CLANG14 $CLANG14.tar.xz \
&& rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/clang-format-$DEFAULT_VERSION /usr/bin/clang-format \
Expand Down

0 comments on commit 41fe38e

Please sign in to comment.