Jenkinsfile aktualisiert
This commit is contained in:
parent
9f994cc5ca
commit
7441aca937
36
Jenkinsfile
vendored
36
Jenkinsfile
vendored
@ -1,50 +1,18 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
label 'docker'
|
||||||
yaml '''
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: docker
|
|
||||||
labels:
|
|
||||||
name: docker
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: buildah
|
|
||||||
image: buildah/buildah:latest
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: "/home/jenkins/agent"
|
|
||||||
name: "workspace-volume"
|
|
||||||
readOnly: false
|
|
||||||
- name: dind
|
|
||||||
image: docker:24.0.0-rc.1-dind
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: "/home/jenkins/agent"
|
|
||||||
name: "workspace-volume"
|
|
||||||
readOnly: false
|
|
||||||
'''
|
|
||||||
retries 2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Build Docker image') {
|
stage('Build Docker image') {
|
||||||
steps {
|
steps {
|
||||||
container('buildah') {
|
sh 'docker version'
|
||||||
sh 'buildah build --format=docker -f Dockerfile -t onbuild-image .'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Tag Docker image') {
|
stage('Tag Docker image') {
|
||||||
steps {
|
steps {
|
||||||
container('kaniko') {
|
|
||||||
sh 'docker images'
|
sh 'docker images'
|
||||||
sh 'ls -la'
|
sh 'ls -la'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user