update version

This commit is contained in:
ale 2024-08-20 05:11:55 +02:00
parent 2b12088aba
commit 637a5612a4
4 changed files with 65 additions and 24 deletions

33
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,33 @@
image: docker:dind
services:
- docker:dind
stages:
- build_amd64
- build_arm64
before_script:
- docker -v
build_amd64:
stage: build_amd64
needs: []
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker buildx build -t monit:amd64 .
- docker tag monit:amd64 $CI_REGISTRY/manalejandro/monit-docker/monit:amd64
- docker tag monit:amd64 $CI_REGISTRY/manalejandro/monit-docker/monit:latest
- docker push $CI_REGISTRY/manalejandro/monit-docker/monit:amd64
- docker push $CI_REGISTRY/manalejandro/monit-docker/monit:latest
build_arm64:
stage: build_arm64
needs: []
before_script:
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker buildx build --platform arm64 -t monit:arm64 .
- docker tag monit:arm64 $CI_REGISTRY/manalejandro/monit-docker/monit:arm64
- docker push $CI_REGISTRY/manalejandro/monit-docker/monit:arm64

View File

@ -1,16 +1,16 @@
FROM alpine:3.8 FROM alpine:3.20
LABEL maintainer="Luis Miguel Vicente Fuentes" LABEL maintainer="Luis Miguel Vicente Fuentes"
# monit environment variables # monit environment variables
ENV MONIT_VERSION=5.27.0 \ ENV MONIT_VERSION=5.34.0 \
MONIT_HOME=/opt/monit \ MONIT_HOME=/opt/monit \
MONIT_URL=https://mmonit.com/monit/dist \ MONIT_URL=https://mmonit.com/monit/dist \
PATH=$PATH:/opt/monit/bin PATH=$PATH:/opt/monit/bin
# compile and install monit # compile and install monit
RUN \ RUN \
apk add --update gcc musl-dev make libressl-dev file zlib-dev && \ apk add --update gcc musl-dev make libressl-dev file zlib-dev curl libressl3.8-libssl libressl3.8-libcrypto && \
mkdir -p /opt/src; cd /opt/src && \ mkdir -p /opt/src; cd /opt/src && \
wget -qO- ${MONIT_URL}/monit-${MONIT_VERSION}.tar.gz | tar xz && \ wget -qO- ${MONIT_URL}/monit-${MONIT_VERSION}.tar.gz | tar xz && \
cd /opt/src/monit-${MONIT_VERSION} && \ cd /opt/src/monit-${MONIT_VERSION} && \

View File

@ -1,8 +1,6 @@
[![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 # Monit - UNIX Systems Management
Run Monit inside docker. Run Monit inside docker. From project [docker-monit](https://github.com/kijart/docker-monit)
[![Monit](https://mmonit.com/monit/img/logo.png)](https://mmonit.com/monit/) [![Monit](https://mmonit.com/monit/img/logo.png)](https://mmonit.com/monit/)
@ -14,13 +12,7 @@ Default username/password: `admin/monit`
| Docker image | Monit | | Docker image | Monit |
| ---------------------- | --------- | | ---------------------- | --------- |
| `kijart/monit:latest`  | `5.27.0`  | | `monit:latest`   | `5.34.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`  |
| `kijart/monit:1.0.1`  | `5.25.1`  |
| `kijart/monit:1.0.0`  | `5.25.1`  |
## Docker setup ## Docker setup
@ -37,11 +29,18 @@ Docker documentation: <https://docs.docker.com/>
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit` - start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
> note: monitrc is a file! create before docker run. > note: monitrc is a file! create before docker run.
### Build-in docker image arm64
- build docker image `docker buildx build --platform arm64 -t monit .`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
> note: monitrc is a file! create before docker run.
### Docker Hub image ### Docker Hub image
- pull docker image from docker hub: `docker pull kijart/monit:latest` - pull docker image from gitlab: `docker pull registry.gitlab.com/manalejandro/monit-docker/monit:latest`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit:latest` - start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc registry.gitlab.com/manalejandro/monit-docker/monit:latest`
- create a docker container: - create a docker container:
@ -50,7 +49,7 @@ docker create \
--name=monit \ --name=monit \
-p 2812:2812 \ -p 2812:2812 \
-v $(pwd)/monitrc:/etc/monitrc \ -v $(pwd)/monitrc:/etc/monitrc \
kijart/monit:latest registry.gitlab.com/manalejandro/monit-docker/monit:latest
``` ```
### Docker compose ### Docker compose

View File

@ -1,13 +1,22 @@
version: "2"
services: services:
monit: monit:
image: kijart/monit:latest # image: registry.gitlab.com/manalejandro/monit-docker/monit:latest
logging: image: monit
driver: json-file build: .
options: hostname: monit
max-size: "10m" container_name: monit
max-file: "5" restart: always
healthcheck:
test: curl --fail http://admin:monit@monit:2812/ || exit 1
interval: 30s
timeout: 5s
retries: 3
ports: ports:
- 2812:2812 - "2812:2812"
volumes: volumes:
- ./monitrc:/etc/monitrc - ./monitrc:/etc/monitrc
networks:
monitnet:
networks:
monitnet: