build with docker libs

This commit is contained in:
Kameron Kenny 2024-06-26 12:16:12 -04:00
parent e4c7f0852e
commit 472e632f89
No known key found for this signature in database
GPG Key ID: E5006629839D2276
3 changed files with 22 additions and 1 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM telegraf
LABEL version="0.0.1"
LABEL description="telegraf"
RUN test -d /etc/telegraf || mkdir -p /etc/telegraf
COPY telegraf/telegraf.conf /etc/telegraf/telegraf.conf

11
Jenkinsfile vendored
View File

@ -1,6 +1,7 @@
pipeline { pipeline {
agent { agent {
label 'pi501.in.thelinuxpro.net' label 'pi501.in.thelinuxpro.net'
dockerfile true
} }
stages { stages {
@ -14,6 +15,16 @@ pipeline {
} }
} }
stage('Build telegraf') {
steps {
docker.withRegistry('http://docker-registry1.in.thelinuxpro.net:5000')
def dockerfile = 'Dockerfile'
def telegrafImage = docker.build("telegraf:${env.BUILD_ID}", "-f ${dockerfile}")
telegrafImage.push()
telegrafImage.push('latest')
}
}
stage('Create contexts') { stage('Create contexts') {
steps { steps {
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"' sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'

View File

@ -23,7 +23,10 @@ services:
- "8086:8086" - "8086:8086"
telegraf: telegraf:
image: telegraf container_name: telegraf
build:
dockerfile: Dockerfile.telegraf
image: docker-registry1.in.thelinuxpro.net:5000/tlp/telegraf:latest
depends_on: depends_on:
- influxdb - influxdb
volumes: volumes: