-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
ARG BASE_TAG="bookworm-slim" | ||
|
||
FROM debian:$BASE_TAG | ||
|
||
ENV QODANA_DATA="/data" \ | ||
QODANA_DOCKER="true" | ||
ENV PATH="/opt/qodana:${PATH}" | ||
|
||
ENV CXX="/usr/lib/llvm-16/bin/clang++" \ | ||
CC="/usr/lib/llvm-16/bin/clang" \ | ||
CPLUS_INCLUDE_PATH="/usr/lib/clang/16/include" | ||
|
||
RUN apt-get -qq update; \ | ||
apt-get install -qqy --no-install-recommends \ | ||
gnupg2 \ | ||
wget \ | ||
ca-certificates \ | ||
apt-transport-https \ | ||
autoconf \ | ||
automake \ | ||
cmake \ | ||
dpkg-dev \ | ||
file \ | ||
make \ | ||
patch \ | ||
libc6-dev \ | ||
git \ | ||
default-jre | ||
|
||
RUN echo "deb https://apt.llvm.org/bookworm llvm-toolchain-bookworm-16 main" \ | ||
> /etc/apt/sources.list.d/llvm.list && \ | ||
wget -qO /etc/apt/trusted.gpg.d/llvm.asc \ | ||
https://apt.llvm.org/llvm-snapshot.gpg.key && \ | ||
apt-get -qq update && \ | ||
apt-get install -qqy -t \ | ||
llvm-toolchain-bookworm-16 \ | ||
clang-16 clang-tidy-16 \ | ||
clang-format-16 lld-16 \ | ||
libc++-16-dev \ | ||
libc++abi-16-dev && \ | ||
for f in /usr/lib/llvm-16/bin/*; do ln -sf "$f" /usr/bin; done && \ | ||
ln -sf clang /usr/bin/cc && \ | ||
ln -sf clang /usr/bin/c89 && \ | ||
ln -sf clang /usr/bin/c99 && \ | ||
ln -sf clang++ /usr/bin/c++ && \ | ||
ln -sf clang++ /usr/bin/g++ && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
mkdir -p /opt/qodana $QODANA_DATA/project $QODANA_DATA/cache $QODANA_DATA/results | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y sudo && \ | ||
useradd -m -u 1001 -U qodana && \ | ||
passwd -d qodana && \ | ||
echo 'qodana ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
ARG QD_RELEASE="2024.1" | ||
ARG QD_BUILD="QDCL-$QD_RELEASE" | ||
# hadolint ignore=DL3003,SC2043 | ||
RUN set -ex && \ | ||
dpkgArch="$(dpkg --print-architecture)" && \ | ||
case "$dpkgArch" in \ | ||
"amd64") \ | ||
OS_ARCH_SUFFIX=""; \ | ||
;; \ | ||
"arm64") \ | ||
OS_ARCH_SUFFIX="-aarch64"; \ | ||
;; \ | ||
*) echo "Unsupported architecture $dpkgArch" >&2; exit 1 ;; \ | ||
esac && \ | ||
QD_NAME="qodana-$QD_BUILD$OS_ARCH_SUFFIX" \ | ||
QD_URL="https://download.jetbrains.com/qodana/$QD_RELEASE/$QD_NAME.tar.gz" && \ | ||
curl -fsSL "$QD_URL" -o "/tmp/$QD_NAME.tar.gz" \ | ||
"$QD_URL.sha256" -o "/tmp/$QD_NAME.tar.gz.sha256" \ | ||
"$QD_URL.sha256.asc" -o "/tmp/$QD_NAME.tar.gz.sha256.asc" && \ | ||
GNUPGHOME="$(mktemp -d)" && \ | ||
export GNUPGHOME && \ | ||
for key in \ | ||
"B46DC71E03FEEB7F89D1F2491F7A8F87B9D8F501" \ | ||
; do \ | ||
gpg --batch --keyserver "hkps://keys.openpgp.org" --recv-keys "$key" || \ | ||
gpg --batch --keyserver "keyserver.ubuntu.com" --recv-keys "$key" ; \ | ||
done && \ | ||
gpg --verify "/tmp/$QD_NAME.tar.gz.sha256.asc" "/tmp/$QD_NAME.tar.gz.sha256" && \ | ||
(cd /tmp && sha256sum --check --status "$QD_NAME.tar.gz.sha256") && \ | ||
mkdir -p /tmp/qd && tar -xzf "/tmp/$QD_NAME.tar.gz" --directory /opt/qodana && \ | ||
mv /opt/qodana/qodana-clang /opt/qodana/qodana && \ | ||
chmod +x /opt/qodana/qodana && \ | ||
apt-get purge --auto-remove -y gnupg2 && \ | ||
rm -rf /var/cache/apt /var/lib/apt/ /tmp/* "$GNUPGHOME" | ||
|
||
ENV PATH="/opt/qodana:${PATH}" | ||
|
||
LABEL maintainer="[email protected]" description="Qodana for C/C++ (CMake)" | ||
WORKDIR /data/project | ||
ENTRYPOINT ["qodana", "scan"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,6 @@ RUN set -ex && \ | |
|
||
ENV PATH="/opt/qodana:${PATH}" | ||
|
||
LABEL maintainer="[email protected]" description="Qodana for .NET Community" | ||
LABEL maintainer="[email protected]" description="Qodana Community for .NET" | ||
WORKDIR /data/project | ||
ENTRYPOINT ["qodana", "scan"] |