Skip to content

Commit b2c11b2

Browse files
authored
Merge pull request #775 from jmrenouard/master
Docker staff for MySQLtuner
2 parents 4a7d0e0 + def7f81 commit b2c11b2

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

Dockerfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ RUN apt-get update && apt upgrade -y && apt-get install -yq --no-install-recomme
1212
perl-doc \
1313
mysql-client \
1414
libjson-perl \
15+
libtext-template-perl \
1516
&& apt-get clean \
1617
&& rm -rf /var/lib/apt/lists/* \
17-
&& echo "Downloading MySQL Tuner script ..." \
18-
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -O /mysqltuner.pl \
19-
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O /basic_passwords.txt \
20-
&& wget --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O /vulnerabilities.csv
18+
&& mkdir -p /results
2119

22-
ENTRYPOINT ["perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt" , "--cvefile", "/vulnerabilities.txt", "--nosysstat", "--defaults-file", "/defaults.cnf" ]
23-
CMD ["--verbose"]
20+
WORKDIR /
21+
COPY ./mysqltuner.pl /mysqltuner.pl
22+
COPY ./vulnerabilities.csv /vulnerabilities.txt
23+
COPY ./basic_passwords.txt /basic_passwords.txt
24+
COPY ./template_example.tpl /template.tpl
25+
26+
ENTRYPOINT [ "perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt",\
27+
"--cvefile", "/vulnerabilities.txt", "--nosysstat", "--defaults-file", \
28+
"/defaults.cnf", "--dumpdir", "/results", "--outputfile", \
29+
"/results/mysqltuner.txt", "--template", "/template.tpl", \
30+
"--reportfile", "/results/mysqltuner.html" ]
31+
CMD ["--verbose" ]

build/updateCVElist.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22
use warnings;
33
use strict;
44
use WWW::Mechanize::GZip;
@@ -74,6 +74,7 @@ sub AUTOLOAD {
7474
}
7575
}
7676
close(CVE);
77+
chmod 0644, "./cve.csv", "../vulnerabilities.csv";
7778
#unlink ('cve.csv') if (-f 'cve.csv');
7879

7980
exit(0);

0 commit comments

Comments
 (0)