Files
clang-format/Dockerfile
denis.patrakeev 760ba1a44c [DO-107] 14-node20 (!1)
DO-107

Reviewed-on: https://git.avroid.tech/Docker/clang-format/pulls/1
Co-authored-by: denis.patrakeev <denis.patrakeev@avroid.tech>
Co-committed-by: denis.patrakeev <denis.patrakeev@avroid.tech>
2023-11-01 16:47:18 +03:00

78 lines
2.8 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ARG DOCKER_REGISTRY=harbor.avroid.tech/docker-hub-proxy/library
ARG UBUNTU_VERSION=22.04
# https://hub.docker.com/_/ubuntu
FROM ${DOCKER_REGISTRY}/ubuntu:${UBUNTU_VERSION}
LABEL maintainer="devops <devops@avroid.tech>" \
description="Image with LLVM clang-format, for check sources" \
tools.nodejs.version="20.9.0"
ARG CLANG_TOOLS_VERSION=14
ARG NODEJS_VERSION=20.9.0
ARG UID=2000
ARG GID=2000
ARG USER=jenkins
ARG USER_GROUP=jenkins
ARG USER_HOME=/home/${USER}
# Nexus
ARG NEXUS_DOMAIN_NAME='nexus.avroid.tech'
ARG NEXUS_URL="https://${NEXUS_DOMAIN_NAME}"
ENV TZ Europe/Moscow
# Подавляем вывод в консоль интерактивных диалогов у служебных команд
ENV DEBIAN_FRONTEND noninteractive
RUN sed -ie "s/deb\ http\:\/\/archive.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-archive-ubuntu-com/g" /etc/apt/sources.list \
&& sed -ie "s/deb\ http\:\/\/security.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-security-ubuntu-com/g" /etc/apt/sources.list \
&& echo "Acquire::https::${NEXUS_DOMAIN_NAME}::Verify-Peer \"false\";" > /etc/apt/apt.conf.d/99nexus_proxy_cert \
&& apt-get update \
&& apt-get install -y \
tzdata \
apt-utils \
ca-certificates \
software-properties-common \
wget \
gnupg \
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata \
&& apt-get dist-upgrade -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& groupadd -g ${GID} ${USER_GROUP} \
&& useradd -m -d ${USER_HOME} -g ${GID} -u ${UID} --shell /bin/bash ${USER}
# Install NodeJS from base repo and fix version NodeJS for work Gitea Actions
RUN apt update \
&& apt install -y \
nodejs \
npm \
&& npm i -g n \
&& npm i -g corepack \
&& n install ${NODEJS_VERSION} \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# clan-format from official repository with mirror on Nexus
RUN wget -O - "${NEXUS_URL}/repository/all-raw-proxy-apt-llvm-org/llvm-snapshot.gpg.key" | apt-key add - \
&& add-apt-repository \
"deb ${NEXUS_URL}/repository/all-apt-proxy-apt-llvm-org/jammy/ llvm-toolchain-jammy-${CLANG_TOOLS_VERSION} main" \
&& apt-get update \
&& apt-get install -y \
clang-format-${CLANG_TOOLS_VERSION} \
clang-tidy-${CLANG_TOOLS_VERSION} \
parallel \
&& ln -s /usr/bin/clang-format-${CLANG_TOOLS_VERSION} /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-${CLANG_TOOLS_VERSION} /usr/bin/clang-tidy \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER ${USER}
WORKDIR ${USER_HOME}
CMD ["/bin/bash"]