From a8c936d32a66696d1af2d4cc7277fb574dfaabf9 Mon Sep 17 00:00:00 2001 From: Florian Pelgrim Date: Sun, 2 Sep 2018 07:57:21 +0200 Subject: [PATCH] Docker output (#869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- Dockerfile | 9 ++++++--- requirements-output.txt | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7bd70529..4a3887ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM python:2-alpine3.8 as python-base -MAINTAINER Florian Pelgrim 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 " ENV PYTHONPATH=/cowrie WORKDIR /cowrie EXPOSE 2222/tcp diff --git a/requirements-output.txt b/requirements-output.txt index ca1df616..f4dc4722 100644 --- a/requirements-output.txt +++ b/requirements-output.txt @@ -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