.drone.yml
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2024-12-15 02:53:53 +01:00
parent 431337da6f
commit 4f49c5dc8a
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81
4 changed files with 76 additions and 7 deletions

68
.drone.yml Normal file
View File

@ -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

View File

@ -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

View File

@ -38,9 +38,9 @@ Docker documentation: <https://docs.docker.com/>
### 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

View File

@ -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: