Skip to content

Commit 99c1938

Browse files
veblushmayeut
authored andcommitted
Add manylinux2010_i686 docker image (#355)
1 parent 52c7b5d commit 99c1938

File tree

4 files changed

+91
-27
lines changed

4 files changed

+91
-27
lines changed

.travis.yml

+20-12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ env:
2020
- secure: "lKaTzEL6UNiEfp+BWLOUILG9BMtjwEMpwt6Yag0cQGHix7qJ/ElZ0t3oFw6ZwuDmA5qceAXIdxHLUK9HGVI2MloLk8czGhjvtfJ4XhOxtEJRQ0VkDGPsKN4cfhB4ZjGo6GAPtNqStMyNiY7BZuTrZa7coDLCoUeYcOmTpi6pmd1rrkk725B9QCTuhFHbPhkuL2yu/Jk6WxkHJBKjmuZek+iQa7lRItgMrG0/319PXLvwIGGl00nLFy+Ly5Ciwzux4wuHLTySZQKu0H9FX81A7smM0FW/42kg3ckGa2qLxRw/Pi8Nm/aIk8LD0QXzI5N7HhFfidOTgDS8Mt1HgfxmTk4wUXZ/KvCCshqjimzMc/s9i9wPZX9UqqcfrpZkmwz8dzhm1bndN45ZOCy6xAYT6dzf8T4mLMDjVWSW4+DUoW4sYHRLVujjcMk7ybcwGV43VruPTJnc8XVAhT+VIMQkoPjhQmTOn8h82LRNGYtLa5RReCh9OPKVYB2Quz18FXMWgFt7A6VWudL0c7/8CusLvuo+pLcxt9pnV40rvu1YEohpEj8qR/qTSaDUBZM0J9SVf5zrZR80pZUnXkDF8nm+mcLOTley3YWipU19lCR7dzVyCAiQdVAuNPdnyem3Yk8enGkAJbfLd6eaIDs+p73D0JXh1Nx1px1movVLQH3ohIw="
2121
- secure: "w1614pomHLltkBhqWM2bOvbymFWIWKqSqqIBDvaNn9tbQScioItJoELBT7g7+cD7nyU7OvpQ1U2fk0xVkCeNvYU0xS1vP4o/VnZRpup7f7Tkiq+2rf4fjwYr3HHnJjwak1l9bsw6FkgzKaVvSdiUJHMVxiIuLd3fVozR7qjBBhTDxSlWGOpSgd+ttpgMZwU5zQjdaVQr1D7E8M0979ZnWMrNRyLiAUeHaPILS815b+ijgqR+i5nmu0/FTCGM9Ik4KIzIfWq8AdfPdbRiq8c+LrrTPfyKcIQJaHmfduYRM4LycGWwzkXFBNtLrJ7uFLG9RDVemOHuHOWIJX8qCUIV4XuESXxH3fUQr6r+yxquTJbzXxNtoaLa6tBOTQWKDrRjT4z9Mf9Im14F2V59EUDoQowHx5bjunOH5wg3ruYNKYYBFRYra5kx0CkKrqFBzyl8fTUEQLyx1HWTVUC1WTXEeD/aFKOSIxW5DxZr5W4LLlW2+Raa52ZzY28Q6AdueFQCRzoJ70/GsJRlSsBdWNOHN4gSp1cZuToLWY15y64QhAMVDpikB+V4hmkbceLiTqeWzTStNL1sa32RHr6i/9zeFZw1pMD1+eOg9x6fgODfh2sqr/zPbu2oONsHnc4D2jwsEax4o+Dv5QHLvK7jdyWUmu47a9QReoexXK60jZXs3CA="
2222

23+
# use YAML aliases and anchors to avoid duplication in stages
24+
# c.f. https://github.com/travis-ci/travis-ci/issues/8295#issuecomment-454457787
25+
manylinux-build: &manylinux-build
26+
stage: "Build manylinux images"
27+
before_install:
28+
# Load cached docker images
29+
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
30+
script:
31+
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
32+
deploy:
33+
provider: script
34+
script: docker/deploy.sh
35+
on:
36+
branch: master
37+
repo: pypa/manylinux
38+
2339
jobs:
2440
include:
2541
- stage: "Patch glibc"
@@ -33,17 +49,9 @@ jobs:
3349
before_cache:
3450
# Save tagged docker images
3551
- mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' | grep 'centos-with-vsyscall:latest' | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
36-
- stage: "Build manylinux images"
52+
- <<: *manylinux-build
3753
env:
3854
- PLATFORM="x86_64"
39-
before_install:
40-
# Load cached docker images
41-
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
42-
script:
43-
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
44-
deploy:
45-
provider: script
46-
script: docker/deploy.sh
47-
on:
48-
branch: master
49-
repo: pypa/manylinux
55+
- <<: *manylinux-build
56+
env:
57+
- PLATFORM="i686"

docker/Dockerfile-i686

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM i386/centos:6
2+
LABEL maintainer="The ManyLinux project"
3+
4+
ENV AUDITWHEEL_ARCH i686
5+
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
6+
ENV LC_ALL en_US.UTF-8
7+
ENV LANG en_US.UTF-8
8+
ENV LANGUAGE en_US.UTF-8
9+
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-7/root
10+
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
11+
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib
12+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
13+
14+
# Set a base architecture of yum package to i386
15+
RUN echo "i386" > /etc/yum/vars/basearch
16+
17+
# To have linux32 command
18+
RUN yum -y update && \
19+
yum install -y util-linux-ng
20+
21+
COPY build_scripts /build_scripts
22+
RUN linux32 bash build_scripts/build.sh && rm -r build_scripts
23+
24+
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
25+
26+
ENTRYPOINT ["linux32"]
27+
CMD ["/bin/bash"]

docker/Dockerfile-x86_64

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
FROM quay.io/pypa/manylinux2010_centos-6-no-vsyscall
33
LABEL maintainer="The ManyLinux project"
44

5-
ENV AUDITWHEEL_PLAT manylinux2010_x86_64
5+
ENV AUDITWHEEL_ARCH x86_64
6+
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
67
ENV LC_ALL en_US.UTF-8
78
ENV LANG en_US.UTF-8
89
ENV LANGUAGE en_US.UTF-8
9-
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
10-
ENV LD_LIBRARY_PATH /opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib
10+
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-8/root
11+
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
12+
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib64:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib64/dyninst:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib
1113
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
1214

1315
COPY build_scripts /build_scripts

docker/build_scripts/build.sh

+39-12
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ MANYLINUX2010_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext
3333
# Get build utilities
3434
source $MY_DIR/build_utils.sh
3535

36-
# See https://unix.stackexchange.com/questions/41784/can-yum-express-a-preference-for-x86-64-over-i386-packages
37-
echo "multilib_policy=best" >> /etc/yum.conf
36+
# Prerequisite for architecture
37+
case $AUDITWHEEL_ARCH in
38+
x86_64)
39+
# See https://unix.stackexchange.com/questions/41784/can-yum-express-a-preference-for-x86-64-over-i386-packages
40+
echo "multilib_policy=best" >> /etc/yum.conf
41+
;;
42+
esac
3843

3944
# https://hub.docker.com/_/centos/
4045
# "Additionally, images with minor version tags that correspond to install
@@ -46,19 +51,42 @@ echo "multilib_policy=best" >> /etc/yum.conf
4651
# Decided not to clean at this point: https://github.com/pypa/manylinux/pull/129
4752
yum -y update
4853

49-
# Software collection (for devtoolset-8) and EPEL support (for cmake28 & yasm)
50-
yum -y install centos-release-scl https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
54+
# EPEL support (for cmake28 & yasm)
55+
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
56+
57+
case $AUDITWHEEL_ARCH in
58+
x86_64)
59+
# Install devtoolset-8
60+
yum -y install centos-release-scl
61+
yum -y install \
62+
devtoolset-8-binutils \
63+
devtoolset-8-gcc \
64+
devtoolset-8-gcc-c++ \
65+
devtoolset-8-gcc-gfortran \
66+
;;
67+
i686)
68+
# Install devtoolset-7 (binutils, gcc, gcc-c++, gcc-gfortran)
69+
devtoolset7s=(
70+
"devtoolset-7-runtime-7.1-4.el6.i686.rpm"
71+
"devtoolset-7-binutils-2.28-11.el6.i686.rpm"
72+
"devtoolset-7-gcc-7.3.1-5.10.el6.i686.rpm"
73+
"devtoolset-7-libstdc++-devel-7.3.1-5.10.el6.i686.rpm"
74+
"devtoolset-7-gcc-c++-7.3.1-5.10.el6.i686.rpm"
75+
"devtoolset-7-libquadmath-devel-7.3.1-5.10.el6.i686.rpm"
76+
"devtoolset-7-gcc-gfortran-7.3.1-5.10.el6.i686.rpm"
77+
)
78+
for rpm in "${devtoolset7s[@]}"; do
79+
yum install -y "https://www.repo.cloudlinux.com/cloudlinux/6.10/sclo/devtoolset-7/i386/$rpm"
80+
done
81+
;;
82+
esac
5183

5284
# Development tools and libraries
5385
yum -y install \
5486
automake \
5587
bison \
5688
bzip2 \
5789
cmake28 \
58-
devtoolset-8-binutils \
59-
devtoolset-8-gcc \
60-
devtoolset-8-gcc-c++ \
61-
devtoolset-8-gcc-gfortran \
6290
diffutils \
6391
gettext \
6492
file \
@@ -183,9 +211,9 @@ find /opt/_internal -depth \
183211
# Fix libc headers to remain compatible with C99 compilers.
184212
find /usr/include/ -type f -exec sed -i 's/\bextern _*inline_*\b/extern __inline __attribute__ ((__gnu_inline__))/g' {} +
185213

186-
# remove useless things that have been installed by devtoolset-8
187-
rm -rf /opt/rh/devtoolset-8/root/usr/share/man
188-
find /opt/rh/devtoolset-8/root/usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
214+
# remove useless things that have been installed by devtoolset
215+
rm -rf $DEVTOOLSET_ROOTPATH/usr/share/man
216+
find $DEVTOOLSET_ROOTPATH/usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
189217
rm -rf /usr/share/backgrounds
190218
# if we updated glibc, we need to strip locales again...
191219
localedef --list-archive | grep -v -i ^en_US.utf8 | xargs localedef --delete-from-archive
@@ -194,4 +222,3 @@ build-locale-archive
194222
find /usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
195223
find /usr/local/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
196224
rm -rf /usr/local/share/man
197-

0 commit comments

Comments
 (0)