<commit_before>FROM centos:6.6

MAINTAINER David 

ENV GIT_URL_IOTACPP https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus.git
ENV GIT_REV_IOTACPP develop
ENV GIT_PATH_IOTACPP /opt/iotacpp
ENV IOTACPP_BUILD_TYPE Release
ENV IOTACPP_USER iotagent

RUN yum -y install tar gzip unzip file \
    	   	   cpp gcc gcc-c++ \
           automake autoconf libtool \
           git scons cmake \
           openssl-devel bzip2-devel zlib-devel \
           rpm-build && \
    git clone ${GIT_URL_IOTACPP} ${GIT_PATH_IOTACPP} && \
    cd ${GIT_PATH_IOTACPP} && \
    sed -i CMakeLists.txt \
    	-e 's|^add_test|#add_test|g' \
    -e 's|^add_subdirectory(tests)|#add_subdirectory(tests)|g' \
    -e 's|^enable_testing|#enable_testing|g' \
        -e 's|git@github.com:mongodb/mongo-cxx-driver.git|https://github.com/mongodb/mongo-cxx-driver|g' && \
    source tools/get_version_string.sh && \
    mkdir -p  build/${IOTACPP_BUILD_TYPE} && \
    cd build/${IOTACPP_BUILD_TYPE} && \
    cmake -DGIT_VERSION=`get_rpm_version_string | cut -d ' ' -f 1` \
    	  -DGIT_COMMIT=`get_rpm_version_string | cut -d ' ' -f 2` \
      -DMQTT=ON \
      -DCMAKE_BUILD_TYPE=${IOTACPP_BUILD_TYPE} ../../ && \
    make install && \
    make package && \
    cd pack/Linux/RPM 
   
RUN yum clean all

RUN yum -y remove autoconf automake bzip2-devel \
          cmake cpp file gcc gcc-c++ git \
         libtool openssl-devel rpm-build \
         scons zlib-devel bzip2 cloog-ppl \
         elfutils elfutils-libs gdb glibc-devel \
         glibc-headers kernel-headers \
         keyutils-libs-devel krb5-devel \
         libarchive libcom_err-devel libgomp \
         libselinux-devel libsepol-devel \
         libstdc++-devel m4 mpfr patch \
         perl-Error perl-Git perl-Module-Pluggable \
         perl-Pod-Escapes perl-Pod-Simple \
         perl-libs perl-version  \
         ppl rsync
    
    
 RUN cd ${GIT_PATH_IOTACPP} && \
    cd build/${IOTACPP_BUILD_TYPE} && \
    cd pack/Linux/RPM && \
    curl -kOL http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-6/home:oojah:mqtt.repo && \
    mv home:oojah:mqtt.repo /etc/yum.repos.d/ && \
    yum localinstall -y iot-agent-*.rpm && \
    yum clean all && \
    chkconfig iotagent on

RUN chkconfig mosquitto on


RUN chmod +x ${GIT_PATH_IOTACPP}/scripts/*.sh

COPY config.json /etc/iot/
RUN chown ${IOTACPP_USER}:${IOTACPP_USER} /etc/iot/config.json

COPY iotagent_manager.conf /usr/local/iot/config/
RUN chown ${IOTACPP_USER}:${IOTACPP_USER} /usr/local/iot/config/iotagent_manager.conf

COPY iotagent_protocol.conf /usr/local/iot/config/
RUN chown ${IOTACPP_USER}:${IOTACPP_USER} /usr/local/iot/config/iotagent_protocol.conf

COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8080
EXPOSE 8081
EXPOSE 1883




<commit_msg>reduce usage of RUN in Dockerfile<commit_after>FROM centos:6.6

MAINTAINER David

ENV GIT_URL_IOTACPP https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus.git
ENV GIT_REV_IOTACPP develop
ENV GIT_PATH_IOTACPP /opt/iotacpp
ENV IOTACPP_BUILD_TYPE Release
ENV IOTACPP_USER iotagent

RUN yum -y install tar gzip unzip file \
                   cpp gcc gcc-c++ \
           automake autoconf libtool \
           git scons cmake \
           openssl-devel bzip2-devel zlib-devel \
           rpm-build && \
    git clone ${GIT_URL_IOTACPP} ${GIT_PATH_IOTACPP} && \
    cd ${GIT_PATH_IOTACPP} && \
    sed -i CMakeLists.txt \
        -e 's|^add_test|#add_test|g' \
    -e 's|^add_subdirectory(tests)|#add_subdirectory(tests)|g' \
    -e 's|^enable_testing|#enable_testing|g' \
        -e 's|<EMAIL>:mongodb/mongo-cxx-driver.git|https://github.com/mongodb/mongo-cxx-driver|g' && \
    source tools/get_version_string.sh && \
    mkdir -p  build/${IOTACPP_BUILD_TYPE} && \
    cd build/${IOTACPP_BUILD_TYPE} && \
    cmake -DGIT_VERSION=`get_rpm_version_string | cut -d ' ' -f 1` \
          -DGIT_COMMIT=`get_rpm_version_string | cut -d ' ' -f 2` \
      -DMQTT=ON \
      -DCMAKE_BUILD_TYPE=${IOTACPP_BUILD_TYPE} ../../ && \
    make install && \
    make package && \
    cd pack/Linux/RPM && \

    yum clean all && \

    yum -y remove autoconf automake bzip2-devel \
          cmake cpp file gcc gcc-c++ git \
         libtool openssl-devel rpm-build \
         scons zlib-devel bzip2 cloog-ppl \
         elfutils elfutils-libs gdb glibc-devel \
         glibc-headers kernel-headers \
         keyutils-libs-devel krb5-devel \
         libarchive libcom_err-devel libgomp \
         libselinux-devel libsepol-devel \
         libstdc++-devel m4 mpfr patch \
         perl-Error perl-Git perl-Module-Pluggable \
         perl-Pod-Escapes perl-Pod-Simple \
         perl-libs perl-version  \
         ppl rsync && \

    cd ${GIT_PATH_IOTACPP} && \
    cd build/${IOTACPP_BUILD_TYPE} && \
    cd pack/Linux/RPM && \
    curl -kOL http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-6/home:oojah:mqtt.repo && \
    mv home:oojah:mqtt.repo /etc/yum.repos.d/ && \
    yum localinstall -y iot-agent-*.rpm && \
    yum clean all && \
    chkconfig iotagent on && \

    chkconfig mosquitto on

COPY config.json /etc/iot/
COPY iotagent_manager.conf /usr/local/iot/config/
COPY iotagent_protocol.conf /usr/local/iot/config/
COPY docker-entrypoint.sh /

RUN \
    chmod +x ${GIT_PATH_IOTACPP}/scripts/*.sh && \
    chown ${IOTACPP_USER}:${IOTACPP_USER} /etc/iot/config.json && \
    chown ${IOTACPP_USER}:${IOTACPP_USER} /usr/local/iot/config/iotagent_manager.conf && \
    chown ${IOTACPP_USER}:${IOTACPP_USER} /usr/local/iot/config/iotagent_protocol.conf && \
    chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8080
EXPOSE 8081
EXPOSE 1883





{'fraction_non_alphanumeric': 0.1268760907504363, 'fraction_numerical': 0.007678883071553229, 'mean_word_length': 2.555210918114144, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '608812', 'n_tokens_mistral': 2338, 'n_tokens_neox': 2176, 'n_words': 395}