Docker output (#869)

* Full Docker support for output plugins

cowrie makes more fun if there are also all the output plugins available
inside the docker image. And now they are!

* Fixing wrong requirements: snappy vs python-snappy

snappy: “SnapPy is a package for studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures. It is based on the SnapPea kernel written by Jeff Weeks.”

python-snappy: “Python bindings for the snappy compression library from Google.”

We want python-snappy. ;)

* MAINTAINER argument deprecated in Docker

The MAINTAINER keyword is deprecated in Docker and is replaced with the
new syntax.
Also it is now attached to the right container and not to one we
actually throw away.
This commit is contained in:
Florian Pelgrim 2018-09-02 07:57:21 +02:00 committed by Michel Oosterhof
parent b9d02904f1
commit a8c936d32a
2 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,4 @@
FROM python:2-alpine3.8 as python-base
MAINTAINER Florian Pelgrim <florian.pelgrim@craneworks.de>
RUN apk add --no-cache libffi && \
addgroup -S cowrie && \
adduser -S -s /bin/bash -G cowrie -D -H -h /cowrie cowrie && \
@ -9,18 +8,21 @@ RUN apk add --no-cache libffi && \
chown -R cowrie:cowrie /cowrie && \
chmod -R 775 /cowrie
COPY requirements.txt .
COPY requirements-output.txt .
COPY data /cowrie/data
COPY honeyfs /cowrie/honeyfs
COPY share /cowrie/share
COPY etc /cowrie/etc
FROM python-base as builder
RUN apk add --no-cache gcc musl-dev python-dev libffi-dev libressl-dev && \
pip wheel --wheel-dir=/root/wheelhouse -r requirements.txt
RUN apk add --no-cache gcc musl-dev python-dev libffi-dev libressl-dev mariadb-dev g++ snappy-dev && \
pip wheel --wheel-dir=/root/wheelhouse -r requirements.txt && \
pip wheel --wheel-dir=/root/wheelhouse -r requirements-output.txt
FROM python-base as post-builder
COPY --from=builder /root/wheelhouse /root/wheelhouse
RUN pip install -r requirements.txt --no-index --find-links=/root/wheelhouse && \
pip install -r requirements-output.txt --no-index --find-links=/root/wheelhouse && \
rm -rf /root/wheelhouse
COPY src /cowrie
@ -34,6 +36,7 @@ WORKDIR /cowrie
RUN trial cowrie
FROM post-builder
LABEL maintainer="Florian Pelgrim <florian.pelgrim@craneworks.de>"
ENV PYTHONPATH=/cowrie
WORKDIR /cowrie
EXPOSE 2222/tcp

View File

@ -16,7 +16,7 @@ hpfeeds3
# mysql
# If this fails, see documentation /home/cowrie/cowrie/docs/sql/README.md
# There are two options, mysqlclient is newer and provides Python3 support.
# mysqlclient
mysqlclient
# MySQL-python
# mongodb
@ -39,7 +39,8 @@ influxdb
# kafka
afkak
snappy
python-snappy
# dblog_xmpp
wokkel==18.0.0rc3