From e2de46e9bf0d62644375521819779c3288dc7098 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Wed, 28 Feb 2018 19:24:43 +0100 Subject: [PATCH] Add Dockerfile to build an image with Alpine linux + monit --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b034122 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM alpine:3.7 + +LABEL maintainer="Luis Miguel Vicente Fuentes " + +# monit environment variables +ENV MONIT_VERSION=5.25.1 \ + MONIT_HOME=/opt/monit \ + MONIT_URL=https://mmonit.com/monit/dist \ + PATH=$PATH:/opt/monit/bin + +# Compile and install monit +RUN \ + echo "*** compile and install monit ***" && \ + apk add --update gcc musl-dev make libressl-dev file zlib-dev && \ + mkdir -p /opt/src; cd /opt/src && \ + wget -qO- ${MONIT_URL}/monit-${MONIT_VERSION}.tar.gz | tar xz && \ + cd /opt/src/monit-${MONIT_VERSION} && \ + ./configure --prefix=${MONIT_HOME} --without-pam && \ + make && make install && \ + apk del gcc musl-dev make libressl-dev file zlib-dev && \ + rm -rf /var/cache/apk/* /opt/src + +EXPOSE 2812 + +CMD ["monit", "-I", "-B"]