From 936843fb1b2a798311abf04ff040b6f6b4c871e7 Mon Sep 17 00:00:00 2001 From: Jean-Marie RENOUARD Date: Fri, 16 Feb 2024 18:15:50 +0100 Subject: [PATCH] Adding Dockerfile features(part 1) --- .gitignore | 3 ++- Dockerfile | 23 +++++++++++++++++++++++ Makefile | 10 +++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 32242a31d..3d7742deb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ result* result_* sql/*.sql sql/*.csv -cve.csv \ No newline at end of file +cve.csv +default*.cnf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..48bf0f4f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:latest + +LABEL maintainer="jmrenouard@gmail.com" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt upgrade -y && apt-get install -yq --no-install-recommends \ + apt-utils \ + curl \ + wget \ + perl \ + perl-doc \ + mysql-client \ + libjson-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 + +ENTRYPOINT ["perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt" , "--cvefile", "/vulnerabilities.txt", "--nosysstat", "--defaults-file", "/defaults.cnf" ] +CMD ["--verbose"] diff --git a/Makefile b/Makefile index 2d9a17a2e..7186559d1 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,9 @@ generate_cve: git add ./vulnerabilities.csv git commit -m "Generate CVE list at $(shell date --iso=seconds)" +generate_version_file: + grep "# mysqltuner.pl - Version" ./mysqltuner.pl | awk '{ print $NF}' > CURRENT_VERSION.txt + generate_features: perl ./build/genFeatures.sh git add ./FEATURES.md @@ -68,5 +71,10 @@ increment_major_version: git tag -a v$(UPDATE_MINOR_VERSION) -m "Generate $(UPDATE_MAJOR_VERSION) major version at $(shell date --iso=seconds)" git push --tags +docker_build: + docker build . push: - git push \ No newline at end of file + git push + +pull: + git pull