<commit_before>FROM ubuntu:14.04
MAINTAINER <NAME> <<EMAIL>>

ENV CONTAINER_USER=sbx \
    BUILD_TYPE=Release \
    MONO_VERSION=4.0.0 \
    SBX_SRC=/home/sbx/symbooglix \
    SKIP_SUBMODULE_SETUP=1

# FIXME: This is overkill, we don't need everything from mono.
# Note ca-certificates-mono is needed so NuGet can pull down the packages we need.
RUN apt-get update && apt-get -y install wget && \
    wget -O - http://download.mono-project.com/repo/xamarin.gpg |apt-key add - && \
    echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/${MONO_VERSION} main" > /etc/apt/sources.list.d/mono-xamarin.list && \
    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C504E590 && \
    echo 'deb http://ppa.launchpad.net/delcypher/boogaloo-smt/ubuntu trusty main' > /etc/apt/sources.list.d/smt.list && \
    apt-get update && \
    apt-get -y install --no-install-recommends mono-devel ca-certificates-mono z3=4.3.1-0~trusty1

# Create user for container with password set to the user name
# Give it sudo access so it possible to install new packages inside the container.
# NEVER EVER EVER EVER USE THIS CONTAINER IN PRODUCTION DUE HOW EASY IT IS
# TO GET ROOT PRIVILIDGES WITH THE ${CONTAINER_USER} USER!
RUN useradd -m ${CONTAINER_USER} && \
    echo ${CONTAINER_USER}:${CONTAINER_USER} | chpasswd && \
    echo "${CONTAINER_USER}  ALL=(root) ALL" >> /etc/sudoers

WORKDIR /home/${CONTAINER_USER}/

# Setup Python
# Note python3-dev installs gcc. We need that so pyyaml gets built properly
# but remove gcc (and other bits) afterwards to save space
RUN apt-get -y --no-install-recommends install python3 python3-pip libyaml-dev && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 && \
    apt-get -y install python3-dev && \
    pip install psutil pyyaml lit OutputCheck && \
    apt-get remove -y python3-dev && apt-get autoremove -y


# Copy across the sources.
# This assumes that the git submodules have been initialised
RUN mkdir -p ${SBX_SRC}
ADD README.md ${SBX_SRC}/
ADD ExternalLibs ${SBX_SRC}/ExternalLibs/
ADD src ${SBX_SRC}/src
ADD test_programs ${SBX_SRC}/test_programs
ADD utils ${SBX_SRC}/utils
RUN chown --recursive ${CONTAINER_USER} ${SBX_SRC}

# Switch to container user and build
USER ${CONTAINER_USER}
RUN cd ${SBX_SRC} && \
    utils/travis-prepare.sh && \
    utils/travis-build.sh

# Put sbx.exe in the user's PATH
RUN echo 'export PATH=$PATH:${SBX_SRC}/src/SymbooglixDriver/bin/${BUILD_TYPE}' >> \
    /home/${CONTAINER_USER}/.bashrc

# TODO: Run tests in container
<commit_msg>Switch Docker file to use Mono 3.8<commit_after>FROM ubuntu:14.04
MAINTAINER <NAME> <<EMAIL>>

ENV CONTAINER_USER=sbx \
    BUILD_TYPE=Release \
    MONO_VERSION=4.8.0 \
    SBX_SRC=/home/sbx/symbooglix \
    SKIP_SUBMODULE_SETUP=1

# FIXME: This is overkill, we don't need everything from mono.
# Note ca-certificates-mono is needed so NuGet can pull down the packages we need.
RUN apt-get update && apt-get -y install wget && \
    wget -O - http://download.mono-project.com/repo/xamarin.gpg |apt-key add - && \
    echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/${MONO_VERSION} main" > /etc/apt/sources.list.d/mono-xamarin.list && \
    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C504E590 && \
    echo 'deb http://ppa.launchpad.net/delcypher/boogaloo-smt/ubuntu trusty main' > /etc/apt/sources.list.d/smt.list && \
    apt-get update && \
    apt-get -y install --no-install-recommends mono-devel ca-certificates-mono z3=4.3.1-0~trusty1

# Create user for container with password set to the user name
# Give it sudo access so it possible to install new packages inside the container.
# NEVER EVER EVER EVER USE THIS CONTAINER IN PRODUCTION DUE HOW EASY IT IS
# TO GET ROOT PRIVILIDGES WITH THE ${CONTAINER_USER} USER!
RUN useradd -m ${CONTAINER_USER} && \
    echo ${CONTAINER_USER}:${CONTAINER_USER} | chpasswd && \
    echo "${CONTAINER_USER}  ALL=(root) ALL" >> /etc/sudoers

WORKDIR /home/${CONTAINER_USER}/

# Setup Python
# Note python3-dev installs gcc. We need that so pyyaml gets built properly
# but remove gcc (and other bits) afterwards to save space
RUN apt-get -y --no-install-recommends install python3 python3-pip libyaml-dev && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 && \
    apt-get -y install python3-dev && \
    pip install psutil pyyaml lit OutputCheck && \
    apt-get remove -y python3-dev && apt-get autoremove -y


# Copy across the sources.
# This assumes that the git submodules have been initialised
RUN mkdir -p ${SBX_SRC}
ADD README.md ${SBX_SRC}/
ADD ExternalLibs ${SBX_SRC}/ExternalLibs/
ADD src ${SBX_SRC}/src
ADD test_programs ${SBX_SRC}/test_programs
ADD utils ${SBX_SRC}/utils
RUN chown --recursive ${CONTAINER_USER} ${SBX_SRC}

# Switch to container user and build
USER ${CONTAINER_USER}
RUN cd ${SBX_SRC} && \
    utils/travis-prepare.sh && \
    utils/travis-build.sh

# Put sbx.exe in the user's PATH
RUN echo 'export PATH=$PATH:${SBX_SRC}/src/SymbooglixDriver/bin/${BUILD_TYPE}' >> \
    /home/${CONTAINER_USER}/.bashrc

# TODO: Run tests in container

{'fraction_non_alphanumeric': 0.12369767001326008, 'fraction_numerical': 0.012123508240197006, 'mean_word_length': 3.5438898450946645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4276232', 'n_tokens_mistral': 1949, 'n_tokens_neox': 1844, 'n_words': 528}