diff options
Diffstat (limited to 'other/docker/travis/Dockerfile')
-rw-r--r-- | other/docker/travis/Dockerfile | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/other/docker/travis/Dockerfile b/other/docker/travis/Dockerfile new file mode 100644 index 00000000..96bfdab4 --- /dev/null +++ b/other/docker/travis/Dockerfile | |||
@@ -0,0 +1,65 @@ | |||
1 | # This Docker build emulates roughly what Travis CI is doing. It is not exactly | ||
2 | # the same (different tool versions) and success in this image may not | ||
3 | # necessarily mean success on Travis. This image is also not automatically | ||
4 | # tested, so it may get out of date. Send PRs if you use it and it's broken. | ||
5 | # | ||
6 | # For one, we use bionic, not xenial, because xenial's clang is way too old. | ||
7 | FROM ubuntu:16.04 | ||
8 | |||
9 | # Travis environment. | ||
10 | RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
11 | apt-transport-https \ | ||
12 | build-essential \ | ||
13 | ca-certificates \ | ||
14 | curl \ | ||
15 | git \ | ||
16 | pkg-config \ | ||
17 | python-pip \ | ||
18 | python-setuptools \ | ||
19 | python3 \ | ||
20 | software-properties-common \ | ||
21 | wget \ | ||
22 | && apt-get clean \ | ||
23 | && rm -rf /var/lib/apt/lists/* | ||
24 | |||
25 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
26 | RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ | ||
27 | && apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main" \ | ||
28 | && apt-get update && apt-get install --no-install-recommends -y \ | ||
29 | clang-6.0 \ | ||
30 | clang-format-6.0 \ | ||
31 | llvm-6.0 \ | ||
32 | && apt-get clean \ | ||
33 | && rm -rf /var/lib/apt/lists/* | ||
34 | |||
35 | RUN ls /usr/bin/clang-6.0 && ln -s /usr/bin/clang-6.0 /usr/bin/clang \ | ||
36 | && ls /usr/bin/clang++-6.0 && ln -s /usr/bin/clang++-6.0 /usr/bin/clang++ \ | ||
37 | && ls /usr/bin/clang-format-6.0 && ln -s /usr/bin/clang-format-6.0 /usr/bin/clang-format \ | ||
38 | && ls /usr/bin/opt-6.0 && ln -s /usr/bin/opt-6.0 /usr/bin/opt | ||
39 | |||
40 | # Bionic's cmake is too old. | ||
41 | RUN pip install --upgrade pip cmake | ||
42 | |||
43 | # .travis.yml | ||
44 | RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
45 | libconfig-dev \ | ||
46 | libgtest-dev \ | ||
47 | libopus-dev \ | ||
48 | libsodium-dev \ | ||
49 | libvpx-dev \ | ||
50 | ninja-build \ | ||
51 | pylint3 \ | ||
52 | && apt-get clean \ | ||
53 | && rm -rf /var/lib/apt/lists/* | ||
54 | |||
55 | # Set up travis user. | ||
56 | RUN groupadd -r -g 1000 travis \ | ||
57 | && useradd --no-log-init -r -g travis -u 1000 travis \ | ||
58 | && mkdir -p /src/workspace /home/travis \ | ||
59 | && chown travis:travis /home/travis | ||
60 | USER travis | ||
61 | |||
62 | # Set up environment. | ||
63 | ENV CC=gcc CXX=g++ \ | ||
64 | PATH=/home/travis/.local/bin:$PATH \ | ||
65 | TRAVIS_REPO_SLUG=TokTok/c-toxcore | ||