-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker:build-clang-5] [docker:build-clang-6]
- Loading branch information
Showing
49 changed files
with
278 additions
and
582 deletions.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,76 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
PUSH=false | ||
ID="${CIRCLE_SHA1:-latest}" | ||
|
||
function usage { | ||
echo "Usage: $0 [args] <image>" | ||
echo "" | ||
echo "Arguments:" | ||
echo " -p, --push Pushes the resulting image to Docker Hub (only for builds with an ID)" | ||
echo " -i, --id Specifies the ID of the image. Defaults to \`${CIRCLE_SHA1:-latest}\`" | ||
exit 1 | ||
} | ||
|
||
declare -a ARGS | ||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
-p|--push) | ||
PUSH=true | ||
shift | ||
;; | ||
-i|--id) | ||
if [ -z "${2:-}" ]; then | ||
echo -e "\033[31m$1 is missing an argument\033[0m\n" | ||
usage | ||
fi | ||
ID="${2}" | ||
shift | ||
shift | ||
;; | ||
-*) | ||
echo "Unknown argument $1" | ||
usage | ||
;; | ||
*) | ||
ARGS+=("$1") | ||
shift | ||
;; | ||
esac | ||
done | ||
if [ ${#ARGS[@]} -ne 0 ]; then | ||
set -- "${ARGS[@]}" | ||
fi | ||
|
||
if [ -z "${1:-}" ]; then | ||
usage | ||
fi | ||
IMAGE="$1" | ||
|
||
if [ ! -r "images/$IMAGE" ]; then | ||
echo "Can't find image $IMAGE" | ||
exit 1 | ||
fi | ||
|
||
if [ $PUSH = true ] && [ "$ID" == "latest" ]; then | ||
echo -e "\033[31mCan't push images without a named ID. Try setting CIRCLE_SHA1 to the commit sha\033[0m\n" | ||
usage | ||
fi | ||
|
||
|
||
# Add HTTP proxy for local testing if there is an apt-proxy running. | ||
PREFIX= | ||
if nc -z localhost 3142 2>/dev/null; then | ||
PREFIX=$'\n''RUN echo "Acquire::http { Proxy \\"http://host.docker.internal:3142\\"; };" >> /etc/apt/apt.conf.d/01proxy' | ||
fi | ||
|
||
|
||
# Add prefix to the Docker file and pipe it into stdin | ||
sed -e '/^FROM /a\'"$PREFIX" "images/$IMAGE" | docker build -t "mbgl/$IMAGE:${ID:0:10}" images -f - | ||
|
||
if [ $PUSH = true ]; then | ||
docker push "mbgl/$IMAGE:${ID:0:10}" | ||
fi |
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,48 @@ | ||
FROM ubuntu:bionic-20180821 | ||
ENV DEBIAN_FRONTEND="noninteractive" | ||
|
||
# libsysconfcpus.so can be used to alter the number of CPUs reported by the system | ||
COPY libsysconfcpus.so /usr/lib/ | ||
ENV LD_PRELOAD=/usr/lib/libsysconfcpus.so | ||
|
||
RUN set -eu \ | ||
&& apt-get update \ | ||
&& apt-get -y install git make curl python ccache zlib1g-dev libcurl4-openssl-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Node.js | ||
# Check https://nodejs.org/en/download/releases/ for releases + hashes | ||
RUN set -eu && VERSION=8.12.0 HASH=3df19b748ee2b6dfe3a03448ebc6186a3a86aeab557018d77a0f7f3314594ef6 \ | ||
&& SLUG=node-v$VERSION-linux-x64 \ | ||
&& curl -L --retry 3 -O https://nodejs.org/dist/v$VERSION/$SLUG.tar.gz \ | ||
&& (echo "$HASH $SLUG.tar.gz" | shasum -c) \ | ||
&& tar xzf $SLUG.tar.gz --strip-components=1 -C /usr $SLUG/bin $SLUG/lib $SLUG/share \ | ||
&& rm $SLUG.tar.gz | ||
|
||
# Install CMake | ||
# Check https://cmake.org/download/ for releases + hashes | ||
RUN set -eu && MAJOR=3 MINOR=12 PATCH=2 HASH=5bd6e37590b929e26e67fbbff1278e77858ab40430f103ea20a9928435e64662 \ | ||
&& SLUG=cmake-$MAJOR.$MINOR.$PATCH-Linux-x86_64 \ | ||
&& curl -L --retry 3 -O https://cmake.org/files/v$MAJOR.$MINOR/$SLUG.tar.gz \ | ||
&& (echo "$HASH $SLUG.tar.gz" | shasum -c) \ | ||
&& tar xzf $SLUG.tar.gz --strip-components=1 -C /usr $SLUG/bin/cmake $SLUG/share/cmake-$MAJOR.$MINOR \ | ||
&& rm $SLUG.tar.gz | ||
|
||
# Install OpenGL-related packages | ||
RUN set -eu \ | ||
&& apt-get update \ | ||
&& apt-get -y install libx11-dev libgl1-mesa-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Clang | ||
RUN set -eu \ | ||
&& apt-get update \ | ||
&& apt-get -y install clang-5.0 clang-tidy-5.0 clang-format-5.0 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV CC="clang-5.0" \ | ||
CXX="clang++-5.0" \ | ||
CLANG_FORMAT="clang-format-5.0" \ | ||
CLANG_TIDY="clang-tidy-5.0" | ||
|
||
WORKDIR /src |
Oops, something went wrong.