FROM ubuntu:jammy-20260217 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 \ make \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /results WORKDIR / COPY ./mysqltuner.pl /mysqltuner.pl COPY ./basic_passwords.txt /basic_passwords.txt COPY ./template_example.tpl /template.tpl COPY ./vulnerabilities.csv /vulnerabilities.txt ENTRYPOINT ["perl", "/mysqltuner.pl", "--passwordfile", "/basic_passwords.txt", "--nosysstat", "--cvefile", "/vulnerabilities.txt", "--dumpdir", "/results", "--outputfile", "/results/mysqltuner.txt", "--template", "/template.tpl", "--reportfile", "/results/mysqltuner.html", "--verbose"]
# Exclude version control and large unnecessary directories .git .gitignore node_modules/ vendor/ tests/ .github/ Dockerfile .dockerignore releases/ documentation/ # Exclude build artifacts *.o *.a *.so *.dll *.class *.pyc *.pyo __pycache__/
Concerns: No build from source is performed; this Dockerfile merely installs dependencies and runs an existing Perl script, which does not satisfy a 'build from source' criterion., COPY uses template_example.tpl, which may fail if the source file does not exist in the build context; this is a potential missing-file issue., FROM uses a dated Ubuntu image tag (ubuntu:jammy-20260217); while functional, it may be brittle or outdated compared to using a stable tag like ubuntu:22.04.
FROM ubuntu:jammy-20260217 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 \ make \ dos2unix \ perltidy \ libpod-markdown-perl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /results WORKDIR /app # Copy source files into the image COPY ./mysqltuner.pl /app/mysqltuner.pl COPY ./basic_passwords.txt /app/basic_passwords.txt COPY ./template_example.tpl /template.tpl COPY ./template_example.tpl /app/template_example.tpl COPY ./vulnerabilities.csv /app/vulnerabilities.csv # Basic syntax check and light build steps from source RUN perl -c /app/mysqltuner.pl RUN pod2markdown /app/mysqltuner.pl > /app/USAGE.md # Generate CVE list and features to simulate a build step without requiring git RUN /bin/sh -lc 'set -e; if [ -x /usr/bin/perl ]; then true; else exit 1; fi' RUN perl /app/build/updateCVElist.pl RUN /bin/sh -lc 'set -e; if [ -f /app/build/genFeatures.sh ]; then bash /app/build/genFeatures.sh; fi' # Expose a default runtime directory for results VOLUME ["/results"] ENTRYPOINT ["perl", "/app/mysqltuner.pl", "--passwordfile", "/app/basic_passwords.txt", "--nosysstat", "--cvefile", "/app/vulnerabilities.csv", "--dumpdir", "/results", "--outputfile", "/results/mysqltuner.txt", "--template", "/template.tpl", "--reportfile", "/results/mysqltuner.html", "--verbose"]
Concerns: Build step runs /app/build/updateCVElist.pl, but /app/build/updateCVElist.pl is not present in the image (no COPY for build directory), so the build will fail.
FROM ubuntu:jammy-20260217
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 \
make \
dos2unix \
perltidy \
libpod-markdown-perl \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /results
WORKDIR /src
# Copy repository sources into the image
COPY . /src
# Prepare template and vulnerabilities file in fixed locations
RUN if [ -f "/src/template_example.tpl" ]; then \
cp /src/template_example.tpl /template.tpl; \
fi
RUN if [ -f "/src/template_example.tpl" ]; then \
cp /src/template_example.tpl /template.tpl; \
fi
RUN if [ -f "/src/vulnerabilities.csv" ]; then \
cp /src/vulnerabilities.csv /vulnerabilities.txt; \
fi
# Attempt to build from source in a best-effort fashion
RUN make tidy || true
RUN make generate_usage || true
RUN make generate_features || true
VOLUME ["/results"]
ENTRYPOINT ["perl", "/src/mysqltuner.pl", "--passwordfile", "/src/basic_passwords.txt", "--nosysstat", "--cvefile", "/vulnerabilities.txt", "--dumpdir", "/results", "--outputfile", "/results/mysqltuner.txt", "--template", "/template.tpl", "--reportfile", "/results/mysqltuner.html", "--verbose"]
Concerns: The image relies on /src/template_example.tpl and /src/vulnerabilities.csv to create /template.tpl and /vulnerabilities.txt; if these files are absent in the repo, the runtime may fail due to missing template or CVE data., There are duplicate COPY/template-pivot RUN steps which are redundant but not fatal; could be cleaned up., The make tidy / generate_* steps are chained with '|| true', which means the build may succeed even if these steps fail to produce artifacts. Smoke [PASS]: ls -l /src/mysqltuner.pl Smoke [PASS]: test -f /template.tpl && echo template_ok || echo template_missing Smoke [PASS]: test -f /vulnerabilities.txt && echo vulnerabilities_ok || echo vulnerabilities_missing