From 4f49c5dc8a517e209fe152e5974e7d1e6e4ab2c6 Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 15 Dec 2024 02:53:53 +0100 Subject: [PATCH] .drone.yml Signed-off-by: ale --- .drone.yml | 68 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 4 +-- README.md | 6 ++-- docker-compose.yml | 5 ++-- 4 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f9571df --- /dev/null +++ b/.drone.yml @@ -0,0 +1,68 @@ +kind: pipeline +name: build-linux-arm64-amd64 +type: docker + +platform: + os: linux + arch: arm64 + +clone: + disable: true + +steps: +- name: build-arm64 + image: docker:dind + privileged: true + environment: + USER: + from_secret: user + PASS: + from_secret: pass + REGISTRY: + from_secret: registry + volumes: + - name: etcdocker + path: /etc/docker + - name: dockersock + path: /var/run/docker.sock + commands: + - docker login -u $USER -p $PASS $REGISTRY + - docker buildx build --platform arm64 -t $REGISTRY/monit . + - docker push $REGISTRY/monit + when: + event: + - push + - tag + +- name: build-amd64 + image: docker:dind + privileged: true + environment: + USER: + from_secret: user + PASS: + from_secret: pass + REGISTRY: + from_secret: registry + volumes: + - name: etcdocker + path: /etc/docker + - name: dockersock + path: /var/run/docker.sock + commands: + - docker login -u $USER -p $PASS $REGISTRY + - docker run --rm --privileged $REGISTRY/qemu-user-static --reset -p yes + - docker buildx build --platform amd64 -t $REGISTRY/monit . + - docker push $REGISTRY/monit + when: + event: + - push + - tag + +volumes: +- name: dockersock + host: + path: /var/run/docker.sock +- name: etcdocker + host: + path: /etc/docker diff --git a/Dockerfile b/Dockerfile index b05925f..f2a4516 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM alpine:3.20 +FROM alpine:3.21 LABEL maintainer="Luis Miguel Vicente Fuentes" # monit environment variables -ENV MONIT_VERSION=5.34.0 \ +ENV MONIT_VERSION=5.34.3 \ MONIT_HOME=/opt/monit \ MONIT_URL=https://mmonit.com/monit/dist \ PATH=$PATH:/opt/monit/bin diff --git a/README.md b/README.md index 1f35813..a05833f 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,9 @@ Docker documentation: ### Docker Hub image -- pull docker image from gitlab: `docker pull registry.gitlab.com/manalejandro/monit-docker/monit:latest` +- pull docker image from gitlab: `docker pull registry.manalejandro.com/monit:latest` -- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc registry.gitlab.com/manalejandro/monit-docker/monit:latest` +- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc registry.manalejandro.com/monit:latest` - create a docker container: @@ -49,7 +49,7 @@ docker create \ --name=monit \ -p 2812:2812 \ -v $(pwd)/monitrc:/etc/monitrc \ - registry.gitlab.com/manalejandro/monit-docker/monit:latest + registry.manalejandro.com/monit:latest ``` ### Docker compose diff --git a/docker-compose.yml b/docker-compose.yml index c3062ea..1d31109 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: monit: - # image: registry.gitlab.com/manalejandro/monit-docker/monit:latest - image: monit + image: registry.manalejandro.com/monit:latest + # image: monit build: . hostname: monit container_name: monit @@ -10,6 +10,7 @@ services: test: curl --fail http://admin:monit@monit:2812/ || exit 1 interval: 1m retries: 1 + start_period: 1m ports: - "2812:2812" volumes: