From 75b41ca8734f23c0456d2bc5b61fbbccda789725 Mon Sep 17 00:00:00 2001 From: Kameron Kenny <1267885+kkenny@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:57:21 -0400 Subject: [PATCH] add dockerfile to bake a new container with the config. --- Dockerfile | 7 +++++++ Jenkinsfile | 8 ++++++++ docker-compose.yml | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e0e2530 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM prom/prometheus + +LABEL version="20240605.1.1" +LABEL description="bind9 primary nameserver" + +RUN mkdir -p /etc/prometheus +COPY prometheus/prometheus.yml /etc/prometheus diff --git a/Jenkinsfile b/Jenkinsfile index 3572a9e..19e1f74 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,14 @@ pipeline { } } + stage("Build Containers and push to registry") { + steps { + script { + sh 'docker compose build --push' + } + } + } + stage('Create contexts') { steps { sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"' diff --git a/docker-compose.yml b/docker-compose.yml index b31ef4e..eff062d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,9 @@ volumes: services: prometheus: - image: prom/prometheus + build: + dockerfile: Dockerfile + image: docker-registry1.in.thelinuxpro.net:5000/tlp/prometheus:240605.1.1 container_name: prometheus command: '--config.file=/etc/prometheus/prometheus.yml' restart: unless-stopped