diff --git a/10/Dockerfile b/10/Dockerfile index 1d209a0..d1f2cdb 100644 --- a/10/Dockerfile +++ b/10/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 10 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/11-alpine-3.18/Dockerfile b/11-alpine-3.18/Dockerfile index 4e60031..a21743d 100644 --- a/11-alpine-3.18/Dockerfile +++ b/11-alpine-3.18/Dockerfile @@ -1,8 +1,15 @@ FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" +ENV CLANG_VERSION 11 + +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" RUN apk update \ && apk add --no-cache clang-extra-tools \ diff --git a/11/Dockerfile b/11/Dockerfile index 5427fe7..75b2b70 100644 --- a/11/Dockerfile +++ b/11/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 11 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/12-alpine-3.18/Dockerfile b/12-alpine-3.18/Dockerfile index 4e60031..d367e94 100644 --- a/12-alpine-3.18/Dockerfile +++ b/12-alpine-3.18/Dockerfile @@ -1,8 +1,15 @@ FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" +ENV CLANG_VERSION 12 + +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" RUN apk update \ && apk add --no-cache clang-extra-tools \ diff --git a/12/Dockerfile b/12/Dockerfile index 7da441f..239ab32 100644 --- a/12/Dockerfile +++ b/12/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 12 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/13/Dockerfile b/13/Dockerfile index 4f5b3f8..85effe0 100644 --- a/13/Dockerfile +++ b/13/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 13 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN mv /etc/apt/sources.list /etc/apt/sources.list.focal COPY sources.list.jammy /etc/apt/sources.list diff --git a/14/Dockerfile b/14/Dockerfile index c3b224a..88e50a1 100644 --- a/14/Dockerfile +++ b/14/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 14 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN mv /etc/apt/sources.list /etc/apt/sources.list.focal COPY sources.list.jammy /etc/apt/sources.list diff --git a/15/Dockerfile b/15/Dockerfile index 22683a6..2bf9411 100644 --- a/15/Dockerfile +++ b/15/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 15 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN mv /etc/apt/sources.list /etc/apt/sources.list.focal COPY sources.list.kinetic /etc/apt/sources.list diff --git a/16/Dockerfile b/16/Dockerfile index 0558f22..43fb0ef 100644 --- a/16/Dockerfile +++ b/16/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:22.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 16 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + WORKDIR /src RUN apt-get update \ diff --git a/6/Dockerfile b/6/Dockerfile index 52597a3..4d5d4e4 100644 --- a/6/Dockerfile +++ b/6/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 6.0 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/7/Dockerfile b/7/Dockerfile index 3eadf09..d08282a 100644 --- a/7/Dockerfile +++ b/7/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 7 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/8/Dockerfile b/8/Dockerfile index de004e8..c99ce7c 100644 --- a/8/Dockerfile +++ b/8/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 8 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/9/Dockerfile b/9/Dockerfile index 683ef82..70caae9 100644 --- a/9/Dockerfile +++ b/9/Dockerfile @@ -1,11 +1,16 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" - ENV CLANG_VERSION 9 +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" + RUN apt-get update \ && apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \ && ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \ diff --git a/Makefile b/Makefile index 5242091..b11a9b3 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,6 @@ CONTAINER_BIN ?= docker ## Image metadatas COMMIT_SHA ?= =$(shell git rev-parse HEAD) -GIT_SCM_URL ?= $(shell git config --get remote.origin.url) -BUILD_DATE ?= $(shell date --utc '+%Y-%m-%dT%H:%M:%S' 2>/dev/null || gdate --utc '+%Y-%m-%dT%H:%M:%S') check-file: ifeq ($(FILE), unknow) @@ -56,9 +54,7 @@ build: check-file lint ## ## Build the Docker Image $(NAME) from $(DOCKERFILE) @echo "== Building $(IMAGE_NAME) from $(DOCKERFILE)..." @$(CONTAINER_BIN) build \ -t $(IMAGE_NAME) \ - --label "image.source=$(GIT_SCM_URL)" \ - --label "image.revision=$(COMMIT_SHA)" \ - --label "image.created=$(BUILD_DATE)" \ + --label "org.opencontainers.image.revision=$(COMMIT_SHA)" \ -f $(DOCKERFILE) \ $(DIR_NAME) @echo "== Build ✅ image $(IMAGE_NAME) Succeeded." diff --git a/all/Dockerfile b/all/Dockerfile index b643bfe..c933665 100644 --- a/all/Dockerfile +++ b/all/Dockerfile @@ -1,8 +1,13 @@ FROM ubuntu:20.04 -LABEL org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" -LABEL org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." -LABEL org.opencontainers.image.licenses="MIT" +LABEL \ + org.opencontainers.image.vendor="cpp-linter team" \ + org.opencontainers.image.title="Unofficial Clang Tools Docker image" \ + org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \ + org.opencontainers.image.version="clang-tools:all" \ + org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \ + org.opencontainers.image.source="https://github.com/cpp-linter/clang-tools-docker" \ + org.opencontainers.image.licenses="MIT" ENV CLANG_VERSIONS="12 11 10 9 8"