From 47ddef18d773517cf1b717cee45c86918183b6e1 Mon Sep 17 00:00:00 2001 From: Stu Hood Date: Tue, 12 Dec 2017 18:24:53 -0800 Subject: [PATCH] Add a centos6 Dockerfile (#5167) ### Problem The wheels built in #5118 and consumed in #5159 are built in debian wheezy, meaning that they have a glibc 2.13 dependency... centos6 (still consumed in various places at Twitter) uses glibc 2.12. More generally, it is beneficial to have binary releases of pants be compatible with as many linux distributions as possible (those that are in active use, at least). ### Solution Add a centos6 docker image, which was previously confirmed here to be capable of building pants. ### Result In a future change (once this image is published to https://hub.docker.com/r/pantsbuild/), we will switch the linux binary builder shard (`build-support/docker/travis_ci/Dockerfile`) to this image. --- build-support/docker/centos6/Dockerfile | 18 ++++++++++++++++++ build-support/docker/travis_ci/Dockerfile | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 build-support/docker/centos6/Dockerfile diff --git a/build-support/docker/centos6/Dockerfile b/build-support/docker/centos6/Dockerfile new file mode 100644 index 00000000000..94633c30100 --- /dev/null +++ b/build-support/docker/centos6/Dockerfile @@ -0,0 +1,18 @@ +# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +# Use centos6 for compatibility with glibc 2.12. +FROM centos:6 + +# Install python 2.7.13, (more) modern gcc, and a JDK. +RUN yum -y update +RUN yum install -y centos-release-scl +RUN yum install -y \ + devtoolset-7-gcc \ + devtoolset-7-gcc-c++ \ + git \ + java-1.8.0-openjdk-devel \ + python27 + +# By default, execute in an environment with python27 enabled. +ENTRYPOINT ["/usr/bin/scl", "enable", "python27", "devtoolset-7", "--"] diff --git a/build-support/docker/travis_ci/Dockerfile b/build-support/docker/travis_ci/Dockerfile index a4955d060da..9322bae0b27 100644 --- a/build-support/docker/travis_ci/Dockerfile +++ b/build-support/docker/travis_ci/Dockerfile @@ -19,4 +19,7 @@ RUN groupadd --gid ${TRAVIS_GID} ${TRAVIS_GROUP} RUN useradd -d /travis/home -g ${TRAVIS_GROUP} --uid ${TRAVIS_UID} ${TRAVIS_USER} USER ${TRAVIS_USER}:${TRAVIS_GROUP} +# Ensure Pants runs under the 2.7.13 interpreter. +ENV PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==2.7.13']" + WORKDIR /travis/workdir