Add simple clang format DockerImage

This commit is contained in:
ddutchie 2024-03-13 16:18:22 -04:00
parent 064256e0fb
commit d145e1e709
2 changed files with 23 additions and 0 deletions

View file

@ -1,6 +1,18 @@
stages:
- build
build linux clang format:
stage: build
image: docker
services:
- docker:dind
script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- cd linux-clang-format
- docker build -f Dockerfile -t ${CI_REGISTRY_IMAGE}:clangformat .
- docker push ${CI_REGISTRY_IMAGE}:clangformat
build linux x64:
stage: build
image: docker

11
linux-clang-format/Dockerfile Executable file
View file

@ -0,0 +1,11 @@
FROM ubuntu:20.04
LABEL maintainer="suyu"
# Create a user account suyu (UID 1027) that the container will run as
RUN useradd -m -u 1027 -s /bin/bash suyu && \
apt-get update && apt-get -y full-upgrade && \
apt-get install -y git gpg-agent wget && \
wget https://apt.llvm.org/llvm-snapshot.gpg.key && apt-key add ./llvm-snapshot.gpg.key && \
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" >> /etc/apt/sources.list && \
apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y clang-format-15 && \
apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log
USER 1027