Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
Sort of standardize docker build procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Crosson committed Mar 20, 2017
1 parent 3040c3a commit 295ba24
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM ubuntu:xenial
MAINTAINER Eric Crosson <ecrosson@shoretel.com>

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends clang-format-3.8 && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
ln -s "$(which clang-format-3.8)" /usr/bin/clang-format
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
clang-format-3.8=1:3.8-2ubuntu4 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s "$(which clang-format-3.8)" /usr/bin/clang-format

COPY bin/check-formatting /usr/bin/check-formatting

# switch to uid/gid identical to host uid/gid (forks/users), if not
# doing this, files that clang-format written will change user and
# group all to root.
# switch to uid/gid identical to host uid/gid (forks/users), to avoid
# docker from changing all files that written to group 'root'
USER 1000:100

WORKDIR /code
Expand All @@ -20,6 +21,5 @@ ENTRYPOINT []
ARG VERSION
ARG RELEASE_DATE

LABEL vendor="ShoreTel" \
version="${VERSION}" \
LABEL version="${VERSION}" \
release_date="${RELEASE_DATE}"
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Overview
========

This repository contains the version of clang-format we use to standardize the
qseries line of code.
This project provides a docker image containing ``clang-format-3.8``
and a custom script called ``check-formatting``, useful in a ci-context.

TODO: beef up this readme, provide examples, convert to markdown
7 changes: 3 additions & 4 deletions bin/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
set -o nounset
[ "${CI_SERVER:-}" = "yes" ] && set -x

image='ecrosson/clang-format-3.8'

root="$(readlink -f "$(dirname "$0")" | sed -r 's/\/bin.*//')"
tag="$(cat "${root}/tag")"
version="$(cat "${root}/version")"
release_date="$(date +%Y-%m-%d:%H:%M)"

cd "$(readlink -f "$(dirname "$0")/..")" || exit -1
cd "${root}" || exit -1

docker build \
-t "${image}:${version}" \
-t "${tag}:${version}" \
--build-arg VERSION="${version}" \
--build-arg RELEASE_DATE="${release_date}" \
.
1 change: 1 addition & 0 deletions tag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hamroctopus/clang-format-3.8

0 comments on commit 295ba24

Please sign in to comment.