add clang-format-14
This commit is contained in:
44
clang-format-14.dockerfile
Normal file
44
clang-format-14.dockerfile
Normal file
@@ -0,0 +1,44 @@
|
||||
# Stage 1: Build environment
|
||||
FROM docker.io/redhat/ubi8 AS builder
|
||||
|
||||
RUN dnf install -y \
|
||||
cmake \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
python3 \
|
||||
wget \
|
||||
xz \
|
||||
&& dnf clean all
|
||||
|
||||
RUN wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz \
|
||||
&& tar -xf llvm-project-14.0.6.src.tar.xz
|
||||
RUN cmake -S llvm-project-14.0.6.src/llvm -B build \
|
||||
-DLLVM_ENABLE_PROJECTS='clang' \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
-DLLVM_TARGETS_TO_BUILD=""
|
||||
RUN make -C build -j$(nproc) install
|
||||
|
||||
# base final image off ubi8-micro
|
||||
FROM docker.io/redhat/ubi8-micro
|
||||
|
||||
LABEL maintainer="Carl Pearson <me@carlpearson.net>"
|
||||
LABEL org.opencontainers.image.title="clang-format 14"
|
||||
LABEL description="A container with clang-format 14"
|
||||
LABEL org.opencontainers.image.description="A container with clang-format 14"
|
||||
LABEL org.opencontainers.image.source https://github.com/cwpearson/clang-format
|
||||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
# LABEL version="1.0"
|
||||
# LABEL org.opencontainers.image.version="1.0"
|
||||
# LABEL org.opencontainers.image.url="https://example.com"
|
||||
# LABEL org.opencontainers.image.documentation="https://example.com/docs"
|
||||
# LABEL org.opencontainers.image.vendor="Example Corp"
|
||||
|
||||
# clang-format-14 links this
|
||||
COPY --from=builder /lib64/libstdc++.so.6 /lib64/libstdc++.so.6
|
||||
# keep clang-format binary only
|
||||
COPY --from=builder /usr/local/bin/clang-format /usr/local/bin/clang-format
|
||||
# also provide clang-format-14
|
||||
RUN ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-14
|
||||
|
||||
# expect caller to map $PWD into /src with -v flag
|
||||
WORKDIR /src
|
Reference in New Issue
Block a user