From 20ce352f6e6867a5cbc4082510ce33e9138236a6 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Sat, 12 Sep 2020 13:41:23 +0200 Subject: [PATCH 1/9] Change docker-compose.yml version to 2, add logging settings (#2) - `docker-compose.yml` 2.0 and 3.0+ have different compatibility with different Docker versions and it's [preferable](https://stackoverflow.com/a/53636006/961092) to use 2.0 when you don't use swarm; - without logging settings in `docker-compose.yml` Monit container could clog host machine disk space with log in a long-running scenario --- docker-compose.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e11f133..d2c6df2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,12 @@ -version: '3' +version: "2" services: monit: image: "kijart/monit" + logging: + driver: json-file + options: + max-size: "10m" + max-file: "5" ports: - 2812:2812 volumes: From ae1fed3eef44b6713e31059c5b1910b9e4784e6a Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:07:59 +0200 Subject: [PATCH 2/9] Update README format and some docker params --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7022025..a3c8059 100644 --- a/README.md +++ b/README.md @@ -6,27 +6,27 @@ Run Monit inside docker. [Monit](https://mmonit.com/monit/) is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. -Default username/password: admin/monit +Default username/password: `admin/monit` ## Docker setup -Install docker: https://docs.docker.com/engine/installation/ +Install docker: -Install docker compose: https://docs.docker.com/compose/install/ +Install docker compose: -Docker documentation: https://docs.docker.com/ +Docker documentation: ### Build-in docker image - build docker image `docker build -t monit .` -- start monit: `docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit` +- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit` ### Docker Hub image -- pull docker image from docker hub: `docker pull kijart/monit` +- pull docker image from docker hub: `docker pull kijart/monit:latest` -- start monit: `docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit` +- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit:latest` - create a docker container: @@ -35,7 +35,7 @@ docker create \ --name=monit \ -p 2812:2812 \ -v $(pwd)/monitrc:/etc/monitrc \ - kijart/monit + kijart/monit:latest ``` ### Docker compose From a7fda674bebb4f4b85ce9e9cf545ede222915972 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:08:44 +0200 Subject: [PATCH 3/9] Add explicit image latest tag in docker-compose config file --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d2c6df2..f8b2b9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "2" services: monit: - image: "kijart/monit" + image: kijart/monit:latest logging: driver: json-file options: From bb337803a84a80663ee372e1856d86166d9b57d6 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:09:57 +0200 Subject: [PATCH 4/9] Add versions section in README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a3c8059..02431c8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,17 @@ Run Monit inside docker. Default username/password: `admin/monit` +## Versions + +| Docker image | Monit | +| ---------------------- | --------- | +| `kijart/monit:latest`  | `5.26.0`  | +| `kijart/monit:1.2.0`  | `5.26.0`  | +| `kijart/monit:1.1.0`  | `5.25.2`  | +| `kijart/monit:1.0.2`  | `5.25.1`  | +| `kijart/monit:1.0.1`  | `5.25.1`  | +| `kijart/monit:1.0.0`  | `5.25.1`  | + ## Docker setup Install docker: From 8d8278fdb3ff8a3d0528a48fb888a7ac3acf8f36 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:10:49 +0200 Subject: [PATCH 5/9] Add Docker cloud build status badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 02431c8..6c6312d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/kijart/monit.svg)](https://hub.docker.com/r/kijart/monit) + # Monit - UNIX Systems Management Run Monit inside docker. From 9ea25cf3fc3997625eeef5c02b4bde27de672401 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:16:26 +0200 Subject: [PATCH 6/9] Update monit version from 5.26.0 to 5.27.0 --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb8f2bd..cf9c7fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,13 @@ FROM alpine:3.8 LABEL maintainer="Luis Miguel Vicente Fuentes " # monit environment variables -ENV MONIT_VERSION=5.26.0 \ +ENV MONIT_VERSION=5.27.0 \ MONIT_HOME=/opt/monit \ MONIT_URL=https://mmonit.com/monit/dist \ PATH=$PATH:/opt/monit/bin -# Compile and install monit +# 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 && \ From 1617a78e7e211863e4b6a0f1f78367ce2158f63b Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:18:33 +0200 Subject: [PATCH 7/9] Remove email from maintainer label in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cf9c7fa..e7a1f6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.8 -LABEL maintainer="Luis Miguel Vicente Fuentes " +LABEL maintainer="Luis Miguel Vicente Fuentes" # monit environment variables ENV MONIT_VERSION=5.27.0 \ From b05330ee8fd6368d71f59b857ae41b373d4e18f8 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:23:14 +0200 Subject: [PATCH 8/9] Add MIT license --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..920ef68 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Luis Miguel Vicente Fuentes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 1226a902167fa2efc2c0dc9d774c351b4246f546 Mon Sep 17 00:00:00 2001 From: Luis Miguel Vicente Fuentes Date: Sat, 12 Sep 2020 14:24:43 +0200 Subject: [PATCH 9/9] Update versions table with monit 5.27.0 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c6312d..f68f9ae 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ Default username/password: `admin/monit` | Docker image | Monit | | ---------------------- | --------- | -| `kijart/monit:latest`  | `5.26.0`  | +| `kijart/monit:latest`  | `5.27.0`  | +| `kijart/monit:1.3.0`  | `5.27.0`  | | `kijart/monit:1.2.0`  | `5.26.0`  | | `kijart/monit:1.1.0`  | `5.25.2`  | | `kijart/monit:1.0.2`  | `5.25.1`  |