This docker build file is created in order to build mmonit at version 4.3.1 using the patches from the mmonit cracks section.
Download the file Dockerfile
to an empty directory, and place the patches inside a patches/
subfolder and then issue:
docker build -t TAG .
where:
TAG
represents a tag to set on the built image (ie: mmonit:4.3.1
)
After mmonit is built, a container can be created and ran either via docker run
or deployed within the swarm with docker stack deploy
.
+ folder + | +-----+ Dockerfile | +-----+ patches | + | | | +---------+ mmonit.bsdiff.uue | | | +---------+ index.csp.bsdiff.uue | +-----+ rootfs + | +--------+ usr + | +-----+ local + | +-----+ run
where:
mmonit.bsdiff.uue
contains the binary mmonit 4.3.1 patch,index.csp.bsdiff.uue
contains the website patch,run
is a starter script responsible for copying configuration data that is meant to be permanent to the mounted volumeFROM debian:bookworm-slim ADD rootfs / # update package manager RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get dist-upgrade -y && \ apt-get -y autoremove && \ apt-get clean # install preliminary packages RUN apt-get install -y \ coreutils \ bash \ curl \ ca-certificates \ sharutils \ bsdiff \ patch # create the patches (from https://grimore.org/cracks/mmonit/4.3.1) COPY patches/mmonit.bsdiff.uue /tmp/mmonit.bsdiff.uue COPY patches/index.csp.diff /tmp/index.csp.diff # compile RUN mkdir -p /opt && \ curl -o /opt/mmonit.tar.gz "https://mmonit.com/dist/mmonit-4.3.1-linux-x64.tar.gz" && \ cd /opt && \ tar -vxf mmonit.tar.gz && \ rm /opt/mmonit.tar.gz && \ ln -sf mmonit-4.3.1 mmonit && \ echo "Patching mmonit..." && \ uudecode -co /tmp/mmonit.bsdiff /tmp/mmonit.bsdiff.uue && \ bspatch /opt/mmonit/bin/mmonit /tmp/mmonit /tmp/mmonit.bsdiff && \ mv /tmp/mmonit /opt/mmonit/bin/ && \ chmod +x /opt/mmonit/bin/mmonit && \ rm /tmp/*.bsdiff* && \ echo "Patching admin page..." && \ cd /opt/mmonit/docroot/admin/general && \ ls -l && \ cat /tmp/index.csp.diff | patch -p0 && \ rm /tmp/index.csp.diff # move folders for local configuration RUN mv /opt/mmonit/db /opt/mmonit/db.local && \ mv /opt/mmonit/conf /opt/mmonit/conf.local # remove packages that will not be used WORKDIR / RUN apt-get purge -y \ curl \ git \ sharutils \ bsdiff \ patch && \ apt-get autoremove -y EXPOSE 8080 ENTRYPOINT [ "/bin/bash", "/usr/local/bin/run" ]
#!/bin/bash if [ ! -d /data/db ]; then mkdir -p /data/db cp -Rap /opt/mmonit/db.local/* /data/db/ fi if [ ! -d /data/conf ]; then mkdir -p /data/conf cp -Rap /opt/mmonit/conf.local/* /data/conf/ fi ln -sf /data/db /opt/mmonit/db ln -sf /data/conf /opt/mmonit/conf /opt/mmonit/bin/mmonit -d -i start