FROM ubuntu:latest LABEL maintainer="jmrenouard@gmail.com" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get upgrade -y && apt-get install -yq --no-install-recommends \ apt-utils \ curl \ wget \ perl \ perl-doc \ mysql-client \ libjson-perl \ libtext-template-perl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /results RUN apt-get clean || true WORKDIR / COPY ./mysqltuner.pl /mysqltuner.pl COPY ./basic_passwords.txt /basic_passwords.txt COPY ./template_example.tpl /template.tpl # Vulnerabilities CVE data (stub if generated externally) COPY ./vulnerabilities.csv /vulnerabilities.txt ENTRYPOINT [ "perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt", "--nosysstat", "--defaults-file", "--cvefile", "/vulnerabilities.txt", "/defaults.cnf", "--dumpdir", "/results", "--outputfile", "/results/mysqltuner.txt", "--template", "/template.tpl", "--reportfile", "/results/mysqltuner.html", "--verbose" ]
# Ignore VCS and node_modules and build artifacts .git node_modules vendor vendor/* Dockerfile .dockerignore releases *.log *.md *.html *.txt *.tpl *.pl *.cgi *.sh *.snm *.cache *.tmp *.out *.o *.a *.so *.pyc *~ "
Concerns: Not building from source; this container merely installs runtime dependencies and runs a pre-existing Perl script (mysqltuner.pl) rather than compiling any application from source., The ENTRYPOINT array appears malformed: --defaults-file is included without a corresponding path, and the subsequent --cvefile token likely gets consumed as that missing value, causing runtime invocation errors., Potential missing file /defaults.cnf referenced by the entrypoint and not copied in the image; this could cause the script to fail at runtime if it relies on that file.
FROM ubuntu:22.04 LABEL maintainer="jmrenouard@gmail.com" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get upgrade -y && apt-get install -yq --no-install-recommends \ apt-utils \ curl \ wget \ perl \ perl-doc \ mysql-client \ libjson-perl \ libtext-template-perl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /results RUN apt-get clean || true WORKDIR / # Copy core scripts and resources COPY ./mysqltuner.pl /mysqltuner.pl COPY ./basic_passwords.txt /basic_passwords.txt COPY ./template_example.tpl /template.tpl COPY ./vulnerabilities.csv /vulnerabilities.txt # Provide a minimal defaults file if not present by MySQLTuner expectations RUN bash -lc 'echo "" > /defaults.cnf' ENTRYPOINT [ "perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt", "--nosysstat", "--defaults-file", "/defaults.cnf", "--cvefile", "/vulnerabilities.txt", "--dumpdir", "/results", "--outputfile", "/results/mysqltuner.txt", "--template", "/template.tpl", "--reportfile", "/results/mysqltuner.html", "--verbose" ]
Concerns: WORKDIR line uses 'WORKDIR / ' with a trailing space; could be mis-parsed, Redundant apt-get clean step; could be consolidated for smaller image, No explicit verification that runtime can connect to a database; smoke test only checks syntax