Skip to content

Commit 93c1b75

Browse files
committed
Move to CentOS 6.9
CentOS 6.9 includes a new enough OpenSSL (1.0.1e) to allow curl to connect to HTTPS URLs. The official 32-bit Docker image does not include the utils-linux-ng package that contains linux32. Without setting a 32-bit personality, yum will download packages for the the host's architecture. Python 2.6 is included, however, so include a Python implementation of setarch(8) to enable bootstrapping.
1 parent 85efbd9 commit 93c1b75

File tree

7 files changed

+69
-31
lines changed

7 files changed

+69
-31
lines changed

docker/Dockerfile-i686

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM phusion/centos-5-32
1+
FROM i386/centos:6
22
MAINTAINER The ManyLinux project
33

44
ENV LC_ALL=en_US.UTF-8
@@ -8,6 +8,9 @@ ENV PATH /opt/rh/devtoolset-2/root/usr/bin:$PATH
88
ENV LD_LIBRARY_PATH /opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:/usr/local/lib64:/usr/local/lib
99
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
1010

11+
COPY ./prep/linux32 /usr/bin/linux32
12+
RUN chmod +x /usr/bin/linux32
13+
1114
COPY ./build_scripts /build_scripts
1215
RUN linux32 bash build_scripts/build.sh && rm -r build_scripts
1316

docker/Dockerfile-x86_64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM centos:5.11
1+
FROM centos:6.9
22
MAINTAINER The ManyLinux project
33

44
ENV LC_ALL en_US.UTF-8

docker/build_scripts/build.sh

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ OPENSSL_ROOT=openssl-1.0.2n
1313
# Hash from https://www.openssl.org/source/openssl-1.0.2n.tar.gz.sha256
1414
# Matches hash at https://github.com/Homebrew/homebrew-core/blob/99b8ea3594d1f1f78b0fff1fd8ca7d782aa07e13/Formula/openssl.rb#L11
1515
OPENSSL_HASH=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe
16-
EPEL_RPM_HASH=0dcc89f9bf67a2a515bad64569b7a9615edc5e018f676a578d5fd0f17d3c81d4
16+
EPEL_RPM_HASH=e5ed9ecf22d0c4279e92075a64c757ad2b38049bcf5c16c4f2b75d5f6860dc0d
1717
DEVTOOLS_HASH=a8ebeb4bed624700f727179e6ef771dafe47651131a00a78b342251415646acc
1818
# Update to slightly newer, verified Git commit:
1919
# https://github.com/NixOS/patchelf/commit/2a9cefd7d637d160d12dc7946393778fa8abbc58
2020
PATCHELF_VERSION=2a9cefd7d637d160d12dc7946393778fa8abbc58
2121
PATCHELF_HASH=12da4727f09be42ae0b54878e1b8e86d85cb7a5b595731cdc1a0a170c4873c6d
22-
CURL_ROOT=curl-7.57.0
23-
# https://github.com/Homebrew/homebrew-core/blob/e3a8622111ecefe444194cade5cca3c69165e26c/Formula/curl.rb#L6
24-
CURL_HASH=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826
22+
CURL_ROOT=curl-7.58.0
23+
# https://github.com/Homebrew/homebrew-core/blob/b44c24272efdef9a3b2a54d8d8ab72dacfcd580f/Formula/curl.rb#L6
24+
CURL_HASH=1cb081f97807c01e3ed747b6e1c9fee7a01cb10048f1cd0b5f56cfe0209de731
2525
AUTOCONF_ROOT=autoconf-2.69
2626
AUTOCONF_HASH=954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969
2727
AUTOMAKE_ROOT=automake-1.15
@@ -35,20 +35,11 @@ SQLITE_AUTOCONF_HASH=d7dd516775005ad87a57f428b6f86afd206cb341722927f104d3f0cf65f
3535
# Dependencies for compiling Python that we want to remove from
3636
# the final image after compiling Python
3737
# GPG installed to verify signatures on Python source tarballs.
38-
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gpg"
38+
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel"
3939

4040
# Libraries that are allowed as part of the manylinux1 profile
4141
MANYLINUX1_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel ncurses-devel"
4242

43-
# Centos 5 is EOL and is no longer available from the usual mirrors, so switch
44-
# to http://vault.centos.org
45-
# From: https://github.com/rust-lang/rust/pull/41045
46-
# The location for version 5 was also removed, so now only the specific release
47-
# (5.11) can be referenced.
48-
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
49-
sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
50-
sed -i 's/#\(baseurl.*\)mirror.centos.org\/centos\/$releasever/\1vault.centos.org\/5.11/' /etc/yum.repos.d/*.repo
51-
5243
# Get build utilities
5344
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
5445
source $MY_DIR/build_utils.sh
@@ -65,23 +56,24 @@ yum -y update
6556

6657
# EPEL support
6758
yum -y install wget curl
68-
# https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
69-
cp $MY_DIR/epel-release-5-4.noarch.rpm .
70-
check_sha256sum epel-release-5-4.noarch.rpm $EPEL_RPM_HASH
59+
# https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
60+
cp $MY_DIR/epel-release-6-8.noarch.rpm .
61+
check_sha256sum epel-release-6-8.noarch.rpm $EPEL_RPM_HASH
7162

7263
# Dev toolset (for LLVM and other projects requiring C++11 support)
7364
curl -fsSLO http://people.centos.org/tru/devtools-2/devtools-2.repo
7465
check_sha256sum devtools-2.repo $DEVTOOLS_HASH
7566
mv devtools-2.repo /etc/yum.repos.d/devtools-2.repo
76-
rpm -Uvh --replacepkgs epel-release-5*.rpm
77-
rm -f epel-release-5*.rpm
67+
rpm -Uvh --replacepkgs epel-release-6*.rpm
68+
rm -f epel-release-6*.rpm
7869

7970
# Development tools and libraries
8071
yum -y install bzip2 make git patch unzip bison yasm diffutils \
8172
automake which file cmake28 \
8273
kernel-devel-`uname -r` \
8374
devtoolset-2-binutils devtoolset-2-gcc \
8475
devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran \
76+
gpg \
8577
${PYTHON_COMPILE_DEPS}
8678

8779
# Install newest autoconf
@@ -152,7 +144,7 @@ ln -s $PY36_BIN/auditwheel /usr/local/bin/auditwheel
152144
# final image
153145
yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme \
154146
avahi freetype bitstream-vera-fonts \
155-
${PYTHON_COMPILE_DEPS} > /dev/null 2>&1
147+
${PYTHON_COMPILE_DEPS} #> /dev/null 2>&1
156148
yum -y install ${MANYLINUX1_DEPS}
157149
yum -y clean all > /dev/null 2>&1
158150
yum list installed

docker/build_scripts/build_utils.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22
# Helper utilities for build
33

44
PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python
5-
# XXX: the official https server at www.openssl.org cannot be reached
6-
# with the old versions of openssl and curl in Centos 5.11 hence the fallback
7-
# to the ftp mirror:
8-
OPENSSL_DOWNLOAD_URL=ftp://ftp.openssl.org/source
9-
# Ditto the curl sources
10-
# FIXME: This is about the only mirror that supports bootstrapping over a
11-
# broken version of curl. Unfortunately, we are hardcoding the directory used
12-
# to download the new version of curl.
13-
CURL_DOWNLOAD_URL=https://github.com/curl/curl/releases/download/curl-7_57_0
5+
OPENSSL_DOWNLOAD_URL=https://www.openssl.org/source
6+
CURL_DOWNLOAD_URL=https://curl.haxx.se/download
147

158
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
169

-11.9 KB
Binary file not shown.
14.2 KB
Binary file not shown.

docker/prep/linux32

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/python
2+
"""
3+
Emulate linux32, i.e. setarch(8).
4+
"""
5+
import os
6+
import ctypes
7+
import sys
8+
9+
# Retrieved from a 32-bit CentOS 6.9 installation's
10+
# /usr/include/sys/personality.h header.
11+
LINUX_32 = 0x0008
12+
13+
# Grab libc from our process
14+
process_namespace = ctypes.CDLL(None, use_errno=True)
15+
# int personality(unsigned long persona);
16+
__syscall_personality = process_namespace.personality
17+
__syscall_personality.argtypes = [ctypes.c_ulong]
18+
__syscall_personality.restype = ctypes.c_int
19+
20+
21+
def personality(persona):
22+
"""
23+
Wrap behavior of personality(2).
24+
"""
25+
set_persona = __syscall_personality(persona)
26+
if set_persona == -1:
27+
errno = ctypes.get_errno()
28+
OSError(errno, os.strerror(errno))
29+
30+
return set_persona
31+
32+
33+
personality(LINUX_32)
34+
35+
argv = sys.argv[1:]
36+
if not argv:
37+
os.execlp("/bin/sh", "-sh")
38+
elif argv[0] in ('-h', '--h', '-help', '--help'):
39+
print("""Usage:
40+
linux32 [<program> [<argument>...]]
41+
42+
Change the reported architecture to 32 bits.
43+
THIS IS JUST A STUB FOR BOOTSTRAPPING!
44+
Please install utils-linux-ng for the real executable.
45+
""")
46+
elif argv[0].startswith('-'):
47+
print("linux32: Unknown option")
48+
print("linux32: Try `linux32 --help' for more information.")
49+
else:
50+
os.execvp(argv[0], argv)

0 commit comments

Comments
 (0)