Merge branch 'ent-5236-docker-centos-7' into 'develop'

Docker centos7

See merge request artica/pandorafms!3136
This commit is contained in:
Alejandro Fraguas 2020-05-14 16:07:18 +02:00
commit 5f598c2dcc
4 changed files with 77 additions and 97 deletions

0
pandora_server/util/pandora_db.pl Normal file → Executable file
View File

2
tests/.gitignore vendored
View File

@ -1 +1,3 @@
*.pyc *.pyc
geckodriver.log
wmic

View File

@ -1,109 +1,86 @@
FROM centos:centos6 FROM centos:7
MAINTAINER Pandora FMS Team <info@pandorafms.com>
RUN { \ RUN { \
echo '[EPEL]'; \ echo '[artica_pandorafms]'; \
echo 'name = CentOS Epel'; \ echo 'name=CentOS7 - PandoraFMS official repo'; \
echo 'baseurl = http://dl.fedoraproject.org/pub/epel/6/x86_64'; \ echo 'baseurl=http://firefly.artica.es/centos7'; \
echo 'enabled=1'; \
echo 'gpgcheck=0'; \ echo 'gpgcheck=0'; \
echo ''; \
echo '[remi-php72]'; \
echo 'name=Remi php72'; \
echo 'baseurl=http://rpms.remirepo.net/enterprise/6/php72/x86_64/'; \
echo 'enabled=1'; \ echo 'enabled=1'; \
echo 'gpgcheck=0'; \ } > /etc/yum.repos.d/pandorafms.repo
echo ''; \
echo '[remi-safe]'; \
echo 'name=Safe Remis RPM repository'; \
echo 'mirrorlist=http://cdn.remirepo.net/enterprise/$releasever/safe/mirror'; \
echo 'enabled=1'; \
echo 'gpgcheck=0'; \
echo ''; \
} > /etc/yum.repos.d/extra_repos.repo
RUN { \ # Pandora FMS dependencies.
echo '[artica_pandorafms]'; \ RUN yum install -y epel-release vim wget bzip2 curl && \
echo 'name=CentOS6 - PandoraFMS official repo'; \ yum install yum-utils && \
echo 'baseurl=http://artica.es/centos6'; \ yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm && \
echo 'gpgcheck=0'; \ yum-config-manager --disable mysql80-community && \
echo 'enabled=1'; \ yum-config-manager --enable mysql57-community && \
} > /etc/yum.repos.d/pandorafms.repo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
yum-config-manager --enable remi-php74 && \
RUN yum -y update; yum clean all; yum install -y gtk3 python-pip \
RUN yum --disablerepo=updates install -y firefox
# Generic dependencies
RUN yum install -y \
python-pip \ python-pip \
xorg-x11-server-Xvfb; yum clean all; firefox \
RUN pip install pyvirtualdisplay xorg-x11-server-Xvfb \
RUN pip install 'selenium==2.53.0' x11vnc && \
RUN pip install unittest2 wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz && \
RUN pip install testtools tar xvzf geckodriver-v0.26.0-linux64.tar.gz && \
mv geckodriver /usr/bin/ && rm geckodriver-v0.26.0-linux64.tar.gz && \
# Pandora FMS Console dependencies pip install pyvirtualdisplay && \
RUN yum install -y \ pip install "selenium==3.141" && \
git \ pip install unittest2 && \
pip install testtools && \
yum install -y git \
httpd \ httpd \
cronie \ cronie \
ntp \ ntp \
openldap \ openldap \
nfdump \ nfdump \
wget \
curl \
openldap \ openldap \
plymouth \ plymouth \
xterm \ xterm \
php \ php \
php-gd \ php-gd \
graphviz \ graphviz \
php-mysql \ php-mysqlnd \
php-pear-DB \ php-pear-DB \
php-pear \ php-pear \
php-pdo \ php-pdo \
php-mbstring \ php-mbstring \
php-ldap \ php-ldap \
php-snmp \ php-snmp \
php-ldap \ php-ldap \
php-common \ php-common \
php-zip \ php-zip \
php-xmlrpc \ php-xmlrpc \
nmap \ nmap \
xprobe2 \ xprobe2 \
mysql-server \ mysql-server \
mysql; yum clean all; mysql \
# Pandora FMS Server dependencies
RUN yum install -y \
ntp \ ntp \
vim \
htop \ htop \
nano \ nano \
postfix \ postfix \
wmic \ perl-HTML-Tree \
perl-HTML-Tree \ perl-DBI \
perl-DBI \ perl-DBD-mysql \
perl-DBD-mysql \ perl-libwww-perl \
perl-libwww-perl \ perl-XML-Simple \
perl-XML-Simple \ perl-XML-SAX \
perl-XML-SAX \ perl-NetAddr-IP \
perl-NetAddr-IP \
perl-Scope-Guard \ perl-Scope-Guard \
net-snmp \ net-snmp \
net-tools \ net-tools \
perl-IO-Socket-INET6 \ perl-IO-Socket-INET6 \
perl-Socket6 \ perl-Socket6 \
nmap \ perl-Sys-Syslog \
sudo \ nmap \
xprobe2 \ sudo \
make \ xprobe2 \
perl-CPAN \ make \
perl-JSON \ perl-CPAN \
net-snmp-perl \ perl-JSON \
perl-Time-HiRes \ net-snmp-perl \
perl-XML-Twig \ perl-Time-HiRes \
perl-XML-Twig \
perl-Encode-Locale \ perl-Encode-Locale \
net-snmp-utils \ net-snmp-utils \
fontconfig \ fontconfig \
@ -111,20 +88,19 @@ RUN yum install -y \
freetype-devel \ freetype-devel \
fontconfig-devel \ fontconfig-devel \
libstdc++ \ libstdc++ \
perl-Test-Simple; yum clean all; gettext \
cpanminus && \
cpanm Geo::IP && \
mkdir -p /opt/phantomjs/bin && cd /opt/phantomjs/bin && \
wget https://netcologne.dl.sourceforge.net/project/pandora/Tools%20and%20dependencies%20%28All%20versions%29/DEB%20Debian%2C%20Ubuntu/phantomjs && \
chmod +x phantomjs && \
ln -s /opt/phantomjs/bin/phantomjs /usr/bin/ && \
yum update -y && \
echo -e '#!/bin/bash\nhttpd -k $1\n' > /etc/init.d/httpd && \
chmod +x /etc/init.d/httpd && \
yum clean all
RUN wget http://rpmfind.net/linux/centos/6.9/os/i386/Packages/gettext-0.17-18.el6.i686.rpm; \ ADD wmic /usr/bin/
yum localinstall -y gettext-0.17-18.el6.i686.rpm; \
rm -rf gettext-0.17-18.el6.i686.rpm; \
wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/x86_64/rpmforge/RPMS/perl-Geo-IP-1.38-1.el6.rf.x86_64.rpm; \
yum localinstall -y perl-Geo-IP-1.38-1.el6.rf.x86_64.rpm; \
rm -rf perl-Geo-IP-1.38-1.el6.rf.x86_64.rpm;
#Install phantomjs required for export graph pdf.
RUN mkdir -p /opt/phantomjs/bin && cd /opt/phantomjs/bin; \
wget https://netcologne.dl.sourceforge.net/project/pandora/Tools%20and%20dependencies%20%28All%20versions%29/DEB%20Debian%2C%20Ubuntu/phantomjs; \
chmod +x phantomjs; \
ln -s /opt/phantomjs/bin/phantomjs /usr/bin/;
# Install debugg dependencies. # Install debugg dependencies.
RUN yum install -y \ RUN yum install -y \
@ -133,6 +109,7 @@ RUN yum install -y \
gcc \ gcc \
gcc-c++ \ gcc-c++ \
autoconf \ autoconf \
file \
automake && \ automake && \
pecl install Xdebug && \ pecl install Xdebug && \
git clone https://github.com/tideways/php-xhprof-extension && \ git clone https://github.com/tideways/php-xhprof-extension && \
@ -142,7 +119,8 @@ RUN yum install -y \
make && \ make && \
make install && \ make install && \
cd .. && \ cd .. && \
rm -rf php-xhprof-extension rm -rf php-xhprof-extension && \
yum clean all
#Exposing ports for: HTTP, SNMP Traps, Tentacle protocol #Exposing ports for: HTTP, SNMP Traps, Tentacle protocol
EXPOSE 80 162/udp 41121 EXPOSE 80 162/udp 41121

View File

@ -10,7 +10,7 @@ if ('DISPLAY' not in os.environ):
display.start() display.start()
# Go to the installation page. # Go to the installation page.
browser = webdriver.Firefox() browser = webdriver.Firefox(timeout=15)
browser.implicitly_wait(5) browser.implicitly_wait(5)
browser.get('http://localhost/pandora_console/install.php') browser.get('http://localhost/pandora_console/install.php')
assert("Pandora FMS - Installation Wizard" in browser.title) assert("Pandora FMS - Installation Wizard" in browser.title)