Merge branch 'ent-fix-docker-image-from' into 'develop'

Adapted to centos7

See merge request artica/pandorafms!4732
This commit is contained in:
vgilc 2022-03-03 10:01:43 +00:00
commit a4d7653cf9
2 changed files with 63 additions and 9 deletions

View File

@ -20,10 +20,18 @@ RUN cd /tmp/pandorafms/pandora_agents/unix && \
# Set the server's name in Apache's configuration file to avoid warnings.
RUN sed -i "s/#ServerName.*/ServerName localhost:80/" /etc/httpd/conf/httpd.conf
COPY my.cnf /etc/my.cnf
# Install the Pandora FMS Console.
RUN service mysqld start && \
/usr/bin/mysqladmin -u root password "$DB_PASS" && \
service httpd start && \
RUN rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql && \
mkdir -p /var/log/mysql/ && chown mysql. /var/log/mysql && \
chown mysql. -R /var/lib/mysql && \
sudo -u mysql mysqld --initialize --explicit_defaults_for_timestamp && \
sudo -u mysql mysqld --daemonize & \
sleep 15 && \
mysql_default_pass=$(cat /var/log/mysql/mysqld.log | grep "temporary password" | awk '{print $NF}') && \
mysqladmin -u root -p"$mysql_default_pass" --user=root password 'pandora' && \
httpd -k start && \
cp -r /tmp/pandorafms/pandora_console /var/www/html && \
chown -R apache.apache /var/www/html/pandora_console/ && \
python /tmp/pandorafms/tests/install_console.py
@ -33,9 +41,9 @@ RUN echo '<meta http-equiv="refresh" content="0;url=/pandora_console">' > /var/w
# Create the entrypoint script.
RUN echo -e '#/bin/bash\n \
service mysqld start &&\n \
service httpd start &&\n \
service crond start &&\n \
sudo -u mysql mysqld --daemonize &&\n \
httpd -k start &&\n \
/usr/sbin/crond &&\n \
/etc/init.d/pandora_agent_daemon start && \
/etc/init.d/pandora_server start && \
tail -f /var/log/pandora/pandora_server.log' \

46
extras/docker/my.cnf Normal file
View File

@ -0,0 +1,46 @@
[mysqld]
pid-file=/var/run/mysqld/mysqld.pid
log-error=/var/log/mysql/mysqld.log
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
character-set-server=UTF8MB4
skip-character-set-client-handshake
# Mysql optimizations for Pandora FMS
# Please check the documentation in http://pandorafms.com for better results
max_allowed_packet = 32M
innodb_buffer_pool_size = 256M
innodb_lock_wait_timeout = 120
innodb_file_per_table
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M
innodb_log_buffer_size = 16M
#innodb_io_capacity = 100
#thread_cache_size = 8
thread_stack = 256K
max_connections = 130
key_buffer_size=128K
read_buffer_size=128K
read_rnd_buffer_size=128K
sort_buffer_size=256K
join_buffer_size=2M
sql_mode=""
# testing
#innodb_lru_scan_depth = 256
#innodb_page_cleaners = 8
#innodb_buffer_pool_instances = 4
skip_name_resolve
innodb=1
thread_cache_size = 120
table_definition_cache = 4000
table_open_cache = 4000
[mysqld_safe]
log-error=/var/log/mysql/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid