<commit_before># WARNING: Proof of concept. Many hacks in here. In particular, please do not
# use sed to edit code in the production version. This is not okay.

FROM tenforward/centos-i386
LABEL vendor="measurement-lab" description="Docker for building 32 bit mlab slices"

RUN linux32 yum -y update
RUN linux32 yum install -y wget git svn binutils qt gcc make patch libgomp
RUN linux32 yum install -y glibc-headers glibc-devel kernel-headers kernel-devel htop dkms
RUN linux32 yum install -y rpm-builder rpm-build m4 python-devel openssl-devel

RUN linux32 rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
RUN linux32 yum install -y sudo man

RUN git clone --recursive https://github.com/m-lab-tools/utility-support.git
WORKDIR /utility-support
RUN linux32 ./package/slicebuild.sh mlab_utility
RUN linux32 yum install -y /utility-support/build/slicebase-i386/i686/mlab_utility-master-*.mlab.i686.rpm

WORKDIR /

# Build the mlab_utility slice package.
RUN git clone https://github.com/m-lab/collectd-mlab.git
WORKDIR /collectd-mlab
RUN linux32 ls -al
RUN linux32 make rpm

WORKDIR /
RUN linux32 yum install -y http://mirror.measurementlab.net/fedora-epel/6/i386/python-gflags-1.4-3.el6.noarch.rpm
RUN linux32 yum install -y /build/noarch/collectd-mlab-2.0-2.noarch.rpm

RUN sed -i -e 's|for iface in netifaces.interfaces():|for iface in filter(lambda x: "eth0" in x, netifaces.interfaces()):|g' /usr/lib/python2.6/site-packages/mlab/disco/network.py

CMD echo ${SNMP_COMMUNITY} > /home/mlab_utility/conf/snmp.community && exec linux32 /sbin/init<commit_msg>Update docker build for utility docker image (#23)<commit_after># WARNING: we are using a 32bit centos 6.10+ base image.
FROM i386/centos:6
LABEL vendor="measurement-lab" description="Docker for building 32 bit mlab slices"

# Force arch to i386 so all util-linux-ng dependencies are correct.
WORKDIR /etc/yum.repos.d
RUN sed -i -e 's/$basearch/i386/g' *.repo
RUN yum install -y util-linux-ng

# Run all commands using linux32.
RUN linux32 yum -y update
RUN linux32 yum install -y wget git svn binutils qt gcc make patch libgomp
RUN linux32 yum install -y glibc-headers glibc-devel kernel-headers kernel-devel htop dkms
RUN linux32 yum install -y rpm-builder rpm-build m4 python-devel openssl-devel vim sudo man
RUN linux32 yum install -y http://mirror.measurementlab.net/fedora-epel/6/i386/python-gflags-1.4-3.el6.noarch.rpm

RUN linux32 rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

# Build & install mlab_utility RPM package.
WORKDIR /
RUN git clone --recursive https://github.com/m-lab-tools/utility-support.git
WORKDIR /utility-support
RUN linux32 ./package/slicebuild.sh mlab_utility
RUN linux32 yum install -y /utility-support/build/slicebase-i386/i686/mlab_utility-master-*.mlab.i686.rpm
WORKDIR /

# Build & install the collectd-mlab slice package.
RUN git clone https://github.com/m-lab/collectd-mlab.git
WORKDIR /collectd-mlab
RUN linux32 make rpm
WORKDIR /
RUN linux32 yum install -y /build/noarch/collectd-mlab-2.0-2.noarch.rpm

# NOTE: do not run ttys in docker; mingetty spams /var/log/messages with errors.
RUN rm /etc/init/tty*.conf

# Stash environment variables and start init scripts.
CMD echo ${COMMUNITY} > /home/mlab_utility/conf/snmp.community && \
    echo ${HOSTNAME} > /home/mlab_utility/conf/hostname && \
    exec linux32 /sbin/init
{'fraction_non_alphanumeric': 0.10588235294117647, 'fraction_numerical': 0.03852941176470588, 'mean_word_length': 4.076119402985075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3538356', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1202, 'n_words': 353}