|
| 1 | +# Copyright 2017 Google Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +ARG DISTRO_VERSION=17.04 |
| 16 | +FROM ubuntu:${DISTRO_VERSION} |
| 17 | +MAINTAINER "Carlos O'Ryan <coryan@google.com>" |
| 18 | + |
| 19 | +RUN apt-get update |
| 20 | +RUN apt-get install -y \ |
| 21 | + build-essential \ |
| 22 | + git \ |
| 23 | + gcc \ |
| 24 | + g++ \ |
| 25 | + golang \ |
| 26 | + clang \ |
| 27 | + cmake \ |
| 28 | + make \ |
| 29 | + tar \ |
| 30 | + wget |
| 31 | + |
| 32 | +# Install packages that are required for 14.04, but do not exist in later |
| 33 | +# versions. |
| 34 | +RUN if grep -q 14.04 /etc/lsb-release; then apt-get install -y cmake3; fi |
| 35 | + |
| 36 | +# Install optional packages. Their installation fails in 14.04, the matrix |
| 37 | +# is (or will be) setup to only use them for other Ubuntu versions. |
| 38 | +RUN apt-get install -y \ |
| 39 | + clang-4.0 \ |
| 40 | + clang-format \ |
| 41 | + clang-tidy \ |
| 42 | + gcc-4.8 \ |
| 43 | + g++-4.8 \ |
| 44 | + || /bin/true |
| 45 | + |
| 46 | +ARG NCPU=2 |
| 47 | +ARG CXX=g++ |
| 48 | +ARG CC=gcc |
| 49 | + |
| 50 | +# Capture the Travis job number, effectively this busts the cache |
| 51 | +# in each build, which we want anyway. |
| 52 | +ARG TRAVIS_JOB_NUMBER="" |
| 53 | +RUN echo Running build=${TRAVIS_JOB_NUMBER} |
| 54 | + |
| 55 | +# We assume that this is running on a (clean-ish) checkout of |
| 56 | +# google-cloud-cpp, including submodules, and copy the files to a |
| 57 | +# directory where we will build. |
| 58 | +COPY . /var/tmp/build/gccpp |
| 59 | + |
| 60 | +WORKDIR /var/tmp/build/gccpp/build-output |
| 61 | +RUN cmake .. |
| 62 | +RUN make -j ${NCPU} all |
| 63 | +RUN make -j ${NCPU} test || ( cat Testing/Temporary/LastTest.log; exit 1 ) |
0 commit comments