Skip to content
5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine
RUN apk add --no-cache curl wget busybox-extras netcat-openbsd python3 py3-pip bash && \
pip install awscli && \
apk --purge -v del py3-pip
CMD tail -f /dev/null
5 changes: 3 additions & 2 deletions docker/toolbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM alpine
RUN apk add --no-cache curl wget busybox-extras netcat-openbsd python py-pip bash && \
RUN apk add --no-cache curl wget busybox-extras netcat-openbsd python3 py3-pip bash postgresql-client && \
pip install awscli
RUN apk --purge -v del py-pip
RUN apk --purge -v del py3-pip
CMD tail -f /dev/null

37 changes: 37 additions & 0 deletions jenkinsfiles/docker_jenkins.jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pipeline {
agent {
label 'master'
}
triggers {
pollSCM('* * * * *')
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
timestamps()
}
stages {
stage("Docker Build and Push") {
steps {
script {
try {
echo "============= Starting Docker Build and Push ============="
withCredentials([usernamePassword(credentialsId: 'dockerhub_nmore', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh """
docker login -u \$USERNAME -p \$PASSWORD
"""
}

dir('docker/toolbox') {
sh 'docker build -t nmorework/nmore:latest .'
}

sh 'docker push nmorework/nmore:latest'
} catch (Exception e) {
currentBuild.result = 'FAILURE'
error("Build and push failed: ${e.message}")
}
}
}
}
}
}