Dockerfile51 lines · 1460 chars 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"]