tpotce/docker/mailoney/Dockerfile

59 lines
1.7 KiB
Text
Raw Normal View History

2021-09-20 20:20:04 +00:00
FROM debian:buster-slim
2019-08-28 14:41:35 +00:00
#
# Install packages
2021-09-20 20:20:04 +00:00
RUN apt-get update -y && \
apt-get install -y \
2018-05-19 19:43:02 +00:00
autoconf \
2021-09-20 20:20:04 +00:00
automake \
build-essential \
2018-03-25 18:35:32 +00:00
git \
2021-09-20 20:20:04 +00:00
libcap2-bin \
libtool \
python2 \
python2-dev \
python-pip && \
2019-08-28 14:41:35 +00:00
#
# Install libemu
2020-09-04 12:37:28 +00:00
git clone https://github.com/buffer/libemu /root/libemu/ && \
cd /root/libemu/ && \
2020-09-04 12:37:28 +00:00
git checkout e2624361e13588da74a2ce3e1dea0abb59dcf1d0 && \
autoreconf -vi && \
./configure && \
make && \
make install && \
2019-08-28 14:41:35 +00:00
#
# Install libemu python wrapper
2018-05-30 11:20:55 +00:00
pip install --no-cache-dir \
hpfeeds \
pylibemu && \
2019-08-28 14:41:35 +00:00
#
# Install mailoney from git
2020-09-04 12:37:28 +00:00
git clone https://github.com/t3chn0m4g3/mailoney /opt/mailoney && \
cd /opt/mailoney && \
git checkout 85c37649a99e1cec3f8d48d509653c9a8127ea4f && \
2019-08-28 14:41:35 +00:00
#
# Setup user, groups and configs
2021-09-20 20:20:04 +00:00
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 && \
2019-08-28 14:41:35 +00:00
#
# Clean up
2021-09-20 20:20:04 +00:00
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/*
2019-08-28 14:41:35 +00:00
#
2018-05-30 11:20:55 +00:00
# Set workdir and start mailoney
2018-09-11 12:19:26 +00:00
STOPSIGNAL SIGINT
2018-03-31 21:44:11 +00:00
USER mailoney:mailoney
WORKDIR /opt/mailoney/
2021-09-20 20:20:04 +00:00
CMD ["/usr/bin/python2","mailoney.py","-i","0.0.0.0","-p","25","-s","mailrelay.local","-t","schizo_open_relay"]