diff --git a/docker/mailoney/Dockerfile b/docker/mailoney/Dockerfile index 9a1b0116..2376f854 100644 --- a/docker/mailoney/Dockerfile +++ b/docker/mailoney/Dockerfile @@ -1,17 +1,16 @@ -FROM debian:buster-slim +FROM alpine:3.11 # # Install packages -RUN apt-get update -y && \ - apt-get install -y \ +RUN apk -U --no-cache add \ autoconf \ - automake \ - build-essential \ + automake \ + build-base \ git \ - libcap2-bin \ - libtool \ - python2 \ - python2-dev \ - python-pip && \ + libcap \ + libtool \ + py-pip \ + python \ + python-dev && \ # # Install libemu git clone https://github.com/buffer/libemu /root/libemu/ && \ @@ -33,26 +32,23 @@ RUN apt-get update -y && \ git checkout 85c37649a99e1cec3f8d48d509653c9a8127ea4f && \ # # Setup user, groups and configs - addgroup --gid 2000 mailoney && \ - adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 mailoney && \ + addgroup -g 2000 mailoney && \ + adduser -S -H -s /bin/ash -u 2000 -D -g 2000 mailoney && \ chown -R mailoney:mailoney /opt/mailoney && \ setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \ # # Clean up - apt-get purge -y \ - autoconf \ - automake \ - build-essential \ - git \ - libtool \ - python2-dev \ - python-pip && \ - apt-get autoremove --purge -y && \ - apt-get clean && \ - rm -rf /root/* /var/lib/apt/lists/* /tmp/* /var/tmp/* + apk del --purge autoconf \ + automake \ + build-base \ + git \ + py-pip \ + python-dev && \ + rm -rf /root/* && \ + rm -rf /var/cache/apk/* # # Set workdir and start mailoney STOPSIGNAL SIGINT USER mailoney:mailoney WORKDIR /opt/mailoney/ -CMD ["/usr/bin/python2","mailoney.py","-i","0.0.0.0","-p","25","-s","mailrelay.local","-t","schizo_open_relay"] +CMD ["/usr/bin/python","mailoney.py","-i","0.0.0.0","-p","25","-s","mailrelay.local","-t","schizo_open_relay"] diff --git a/docker/mailoney/Dockerfile.new b/docker/mailoney/Dockerfile.new new file mode 100644 index 00000000..9a1b0116 --- /dev/null +++ b/docker/mailoney/Dockerfile.new @@ -0,0 +1,58 @@ +FROM debian:buster-slim +# +# Install packages +RUN apt-get update -y && \ + apt-get install -y \ + autoconf \ + automake \ + build-essential \ + git \ + libcap2-bin \ + libtool \ + python2 \ + python2-dev \ + python-pip && \ +# +# Install libemu + git clone https://github.com/buffer/libemu /root/libemu/ && \ + cd /root/libemu/ && \ + git checkout e2624361e13588da74a2ce3e1dea0abb59dcf1d0 && \ + autoreconf -vi && \ + ./configure && \ + make && \ + make install && \ +# +# Install libemu python wrapper + pip install --no-cache-dir \ + hpfeeds \ + pylibemu && \ +# +# Install mailoney from git + git clone https://github.com/t3chn0m4g3/mailoney /opt/mailoney && \ + cd /opt/mailoney && \ + git checkout 85c37649a99e1cec3f8d48d509653c9a8127ea4f && \ +# +# Setup user, groups and configs + addgroup --gid 2000 mailoney && \ + adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 mailoney && \ + chown -R mailoney:mailoney /opt/mailoney && \ + setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \ +# +# Clean up + apt-get purge -y \ + autoconf \ + automake \ + build-essential \ + git \ + libtool \ + python2-dev \ + python-pip && \ + apt-get autoremove --purge -y && \ + apt-get clean && \ + rm -rf /root/* /var/lib/apt/lists/* /tmp/* /var/tmp/* +# +# Set workdir and start mailoney +STOPSIGNAL SIGINT +USER mailoney:mailoney +WORKDIR /opt/mailoney/ +CMD ["/usr/bin/python2","mailoney.py","-i","0.0.0.0","-p","25","-s","mailrelay.local","-t","schizo_open_relay"]