dockerfiles/cowrie/Dockerfile

78 lines
3.0 KiB
Docker
Raw Normal View History

2017-03-27 11:07:37 +02:00
FROM alpine:edge
2016-05-14 23:49:46 +02:00
2017-01-16 22:13:29 +01:00
ARG MPFR_VERSION=3.1.5
2016-05-14 23:49:46 +02:00
ARG MPC_VERSION=1.0.3
ARG GPG_MPFR="07F3 DBBE CC1A 3960 5078 094D 980C 1976 98C3 739D"
ARG GPG_MPC="AD17 A21E F8AE D8F1 CC02 DBD9 F7D5 C9BF 765C 61E3"
ARG SHA1_MPC="b8be66396c726fdc36ebb0f692ed8a8cca3bcc66"
2017-03-27 13:52:14 +02:00
ENV UID=991 GID=991
2016-05-14 23:49:46 +02:00
2017-03-27 11:07:37 +02:00
RUN BUILD_DEPS=" \
2016-05-14 23:49:46 +02:00
build-base \
libtool \
libffi-dev \
2017-01-16 22:13:29 +01:00
libressl-dev \
2016-05-14 23:49:46 +02:00
python-dev \
gmp-dev \
2017-03-29 14:57:43 +02:00
mariadb-dev \
2017-01-16 22:13:29 +01:00
py2-pip \
2016-05-14 23:49:46 +02:00
tar \
gnupg" \
2017-03-27 11:07:37 +02:00
&& apk -U upgrade && apk add \
2016-05-14 23:49:46 +02:00
${BUILD_DEPS} \
libffi \
gmp \
2017-01-16 22:13:29 +01:00
libressl \
2016-05-14 23:49:46 +02:00
python \
2016-05-15 01:13:06 +02:00
py-setuptools \
openssh-client \
2017-03-29 14:57:43 +02:00
mariadb-client-libs \
2017-03-27 11:07:37 +02:00
tini \
2016-05-14 23:49:46 +02:00
su-exec \
2016-06-03 18:59:45 +02:00
&& cd /tmp && wget -q http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VERSION}.tar.gz \
2016-05-14 23:49:46 +02:00
&& echo "Verifying authenticity of mpfr-${MPFR_VERSION}.tar.gz..." \
&& wget -q http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VERSION}.tar.gz.asc \
&& gpg --recv-keys 98C3739D \
&& FINGERPRINT="$(LANG=C gpg --verify mpfr-${MPFR_VERSION}.tar.gz.asc mpfr-${MPFR_VERSION}.tar.gz 2>&1 \
| sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
&& if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \
&& if [ "${FINGERPRINT}" != "${GPG_MPFR}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
&& echo "All seems good, now unpacking mpfr-${MPFR_VERSION}.tar.gz..." \
&& tar xzf mpfr-${MPFR_VERSION}.tar.gz && cd mpfr-${MPFR_VERSION} \
&& ./configure && make && make install \
2016-06-03 18:59:45 +02:00
&& cd /tmp && wget -q ftp://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz \
2016-05-14 23:49:46 +02:00
&& echo "Verifying both integrity and authenticity of mpc-${MPC_VERSION}.tar.gz..." \
&& CHECKSUM=$(sha1sum mpc-${MPC_VERSION}.tar.gz | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${SHA1_MPC}" ]; then echo "Warning! Checksum does not match!" && exit 1; fi \
&& wget -q ftp://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz.sig \
&& gpg --recv-keys 0xF7D5C9BF765C61E3 \
&& FINGERPRINT="$(LANG=C gpg --verify mpc-${MPC_VERSION}.tar.gz.sig mpc-${MPC_VERSION}.tar.gz 2>&1 \
| sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
&& if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \
&& if [ "${FINGERPRINT}" != "${GPG_MPC}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
&& echo "All seems good, now unpacking mpc-${MPC_VERSION}.tar.gz..." \
&& tar xzf mpc-${MPC_VERSION}.tar.gz && cd mpc-${MPC_VERSION} \
&& ./configure --with-mpfr-lib=/usr/local/lib --with-mpfr-include=/usr/local/include \
&& make && make install \
&& mkdir /cowrie && cd /cowrie \
&& wget -qO- https://github.com/micheloosterhof/cowrie/archive/master.tar.gz | tar xz --strip 1 \
2017-03-27 11:07:37 +02:00
&& pip install --no-cache -r requirements.txt \
2017-03-29 14:57:43 +02:00
&& pip install --no-cache mysql-python \
2016-05-14 23:49:46 +02:00
&& mv cowrie.cfg.dist cowrie.cfg \
&& apk del ${BUILD_DEPS} \
2016-05-30 19:43:23 +02:00
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
2016-05-14 23:49:46 +02:00
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
2017-03-27 13:52:14 +02:00
VOLUME /cowrie/log /cowrie/dl /custom
2016-09-16 17:08:06 +02:00
2016-05-14 23:49:46 +02:00
EXPOSE 2222
2016-09-16 17:08:06 +02:00
2017-01-19 02:31:59 +01:00
LABEL maintainer="Wonderfall <wonderfall@targaryen.house>"
2016-09-16 17:08:06 +02:00
CMD ["run.sh"]