Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker staff for MySQLtuner #775

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);