Skip to content

Commit

Permalink
Merge pull request #775 from jmrenouard/master
Browse files Browse the repository at this point in the history
Docker staff for MySQLtuner
  • Loading branch information
jmrenouard committed Mar 15, 2024
2 parents 4a7d0e0 + def7f81 commit b2c11b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ RUN apt-get update && apt upgrade -y && apt-get install -yq --no-install-recomme
perl-doc \
mysql-client \
libjson-perl \
libtext-template-perl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Downloading MySQL Tuner script ..." \
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -O /mysqltuner.pl \
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O /basic_passwords.txt \
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O /vulnerabilities.csv
&& mkdir -p /results

ENTRYPOINT ["perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt" , "--cvefile", "/vulnerabilities.txt", "--nosysstat", "--defaults-file", "/defaults.cnf" ]
CMD ["--verbose"]
WORKDIR /
COPY ./mysqltuner.pl /mysqltuner.pl
COPY ./vulnerabilities.csv /vulnerabilities.txt
COPY ./basic_passwords.txt /basic_passwords.txt
COPY ./template_example.tpl /template.tpl

ENTRYPOINT [ "perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt",\
"--cvefile", "/vulnerabilities.txt", "--nosysstat", "--defaults-file", \
"/defaults.cnf", "--dumpdir", "/results", "--outputfile", \
"/results/mysqltuner.txt", "--template", "/template.tpl", \
"--reportfile", "/results/mysqltuner.html" ]
CMD ["--verbose" ]
3 changes: 2 additions & 1 deletion build/updateCVElist.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use warnings;
use strict;
use WWW::Mechanize::GZip;
Expand Down Expand Up @@ -74,6 +74,7 @@ sub AUTOLOAD {
}
}
close(CVE);
chmod 0644, "./cve.csv", "../vulnerabilities.csv";
#unlink ('cve.csv') if (-f 'cve.csv');

exit(0);

0 comments on commit b2c11b2

Please sign in to comment.