• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 gRPC authors.
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# Docker file for building protoc and gRPC protoc plugin artifacts.
16# forked from https://github.com/google/protobuf/blob/master/protoc-artifacts/Dockerfile
17
18FROM centos:6.6
19
20RUN yum install -y git \
21                   tar \
22                   wget \
23                   make \
24                   autoconf \
25                   curl-devel \
26                   unzip \
27                   automake \
28                   libtool \
29                   glibc-static.i686 \
30                   glibc-devel \
31                   glibc-devel.i686
32
33# Install GCC 4.8
34RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -P /etc/yum.repos.d
35RUN bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-2.repo'
36RUN bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-2.repo > /etc/yum.repos.d/devtools-i386-2.repo"
37RUN sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-2.repo
38
39# We'll get and "Rpmdb checksum is invalid: dCDPT(pkg checksums)" error caused by
40# docker issue when using overlay storage driver, but all the stuff we need
41# will be installed, so for now we just ignore the error.
42# https://github.com/docker/docker/issues/10180
43RUN yum install -y devtoolset-2-build \
44                   devtoolset-2-toolchain \
45                   devtoolset-2-binutils \
46                   devtoolset-2-gcc \
47                   devtoolset-2-gcc-c++ \
48                   devtoolset-2-libstdc++-devel \
49                   devtoolset-2-libstdc++-devel.i686 || true
50
51# Again, ignore the "Rpmdb checksum is invalid: dCDPT(pkg checksums)" error.
52RUN yum install -y ca-certificates || true  # renew certs to prevent download error for ius-release.rpm
53
54# TODO(jtattermusch): gRPC makefile uses "which" to detect the availability of gcc
55RUN yum install -y which || true
56
57# Update Git to version >1.7 to allow cloning submodules with --reference arg.
58RUN yum remove -y git && yum clean all
59RUN yum install -y https://centos6.iuscommunity.org/ius-release.rpm && yum clean all
60RUN yum install -y git2u && yum clean all
61
62# Start in devtoolset environment that uses GCC 4.8
63CMD ["scl", "enable", "devtoolset-2", "bash"]
64