Dear Kodekloud members,
Can someone assist me what I’m doing wrong in this task ?
First installed plugins, ssh build, credentials, git, pipeline
Added node where to complete job (stapp02)
Here is pipeline code
node('app02'){
stage('Build') {
git credentialsId: 'sarah', url: "http://git.stratos.xfusioncorp.com/sarah/web.git"
sh 'docker build -t stregi01.stratos.xfusioncorp.com:5000/nginx:latest .'
sh 'docker push stregi01.stratos.xfusioncorp.com:5000/nginx:latest'
}
}
Here will be pipeline job console output.
Started by user admin
[Pipeline] Start of Pipeline
[Pipeline] node
Running on app02 in /home/steve/workspace/nginx-container
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] git
The recommended git tool is: NONE
using credential sarah
Fetching changes from the remote Git repository
Checking out Revision c21ca39a1d756825cc09995574bc0e0fc46a2f42 (refs/remotes/origin/master)
Commit message: "Added dockerfile"
> git rev-parse --resolve-git-dir /home/steve/workspace/nginx-container/.git # timeout=10
> git config remote.origin.url http://git.stratos.xfusioncorp.com/sarah/web.git # timeout=10
Fetching upstream changes from http://git.stratos.xfusioncorp.com/sarah/web.git
> git --version # timeout=10
> git --version # 'git version 2.43.5'
using GIT_ASKPASS to set credentials
> git fetch --tags --force --progress -- http://git.stratos.xfusioncorp.com/sarah/web.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f c21ca39a1d756825cc09995574bc0e0fc46a2f42 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master c21ca39a1d756825cc09995574bc0e0fc46a2f42 # timeout=10
> git rev-list --no-walk c21ca39a1d756825cc09995574bc0e0fc46a2f42 # timeout=10
[Pipeline] sh
+ docker build -t stregi01.stratos.xfusioncorp.com:5000/nginx:latest .
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 109B done
#1 DONE 0.0s
#2 [internal] load metadata for docker.io/library/nginx:stable-alpine3.17-slim
#2 DONE 90.7s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [internal] load build context
#4 transferring context: 57B done
#4 DONE 0.0s
#5 [1/2] FROM docker.io/library/nginx:stable-alpine3.17-slim@sha256:5893dc08a2cb01e21592ff469346ebaacf49167fbc949f45e1c29111981b0427
#5 resolve docker.io/library/nginx:stable-alpine3.17-slim@sha256:5893dc08a2cb01e21592ff469346ebaacf49167fbc949f45e1c29111981b0427 0.0s done
#5 sha256:5893dc08a2cb01e21592ff469346ebaacf49167fbc949f45e1c29111981b0427 9.04kB / 9.04kB done
#5 sha256:d0f2d6365b23b7015088c88ee42f119cf585d05558a72d55625e54454c78d3e6 2.11kB / 2.11kB done
#5 sha256:ee5112eafd255a2c921521a50e807fefd946c83b6d623260ff1d01e856423454 7.15kB / 7.15kB done
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 0.1s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 0.1s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 0.1s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 5.1s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 5.3s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 5.3s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 10.2s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 10.5s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 10.5s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 15.2s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 15.6s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 15.6s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 20.2s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 20.6s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 20.6s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 25.3s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0B / 1.80MB 25.7s
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0B / 625B 25.7s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0B / 3.38MB 30.3s
#5 sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 1.80MB / 1.80MB 30.3s done
#5 sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 625B / 625B 30.2s done
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 30.3s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 30.3s
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 1.05MB / 3.38MB 30.4s
#5 extracting sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b
#5 sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 3.38MB / 3.38MB 30.4s done
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 30.5s
#5 extracting sha256:3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b 0.2s done
#5 extracting sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6
#5 extracting sha256:de5d475193dd13b444c2e58fc772d8a3297e370eb90e67e483095bb25f1861a6 0.5s done
#5 extracting sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a
#5 extracting sha256:b407bcc8063852cf7b980fa6d83d6caa2c17b2fa4c10e87835d72f21ed40c41a 0.1s done
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 35.4s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 35.4s
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 35.6s
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 40.5s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 40.5s
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 40.7s
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 45.6s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 45.6s
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 45.8s
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 50.6s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 50.8s
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 50.8s
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0B / 954B 55.7s
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0B / 768B 56.0s
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0B / 1.40kB 56.0s
#5 extracting sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067
#5 sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 954B / 954B 60.3s done
#5 sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 768B / 768B 60.4s done
#5 extracting sha256:da33b1ad0ac4b49641e40469216939f6488c1d8116b2513ba2caa561d4898067 0.1s done
#5 sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 1.40kB / 1.40kB 60.5s done
#5 extracting sha256:a0fbd691d7c1a07fbdeb8b338578f4e199a49e2491eff171105eb0dc7cf61628 0.1s done
#5 extracting sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e
#5 extracting sha256:16eaaaf5f1c0db05389b2c1c2d90db8c9154289520fad38d580acdf2390e846e 0.1s done
#5 DONE 60.8s
#6 [2/2] COPY index.html /usr/share/nginx/html/
#6 DONE 0.1s
#7 exporting to image
#7 exporting layers
#7 exporting layers 0.8s done
#7 writing image sha256:337193823c08dfa39c9a6bd730818e0221bff12843943caab2bd9a726265a405 done
#7 naming to stregi01.stratos.xfusioncorp.com:5000/nginx:latest done
#7 DONE 0.8s
[Pipeline] sh
+ docker push stregi01.stratos.xfusioncorp.com:5000/nginx:latest
The push refers to repository [stregi01.stratos.xfusioncorp.com:5000/nginx]
c21c6e39dc6b: Preparing
66afb7c3e6d1: Preparing
439be94dd989: Preparing
08761a690f84: Preparing
419b89bbfa3b: Preparing
5fa2288e0d6e: Preparing
f4111324080c: Preparing
f4111324080c: Waiting
5fa2288e0d6e: Waiting
08761a690f84: Pushed
439be94dd989: Pushed
419b89bbfa3b: Pushed
c21c6e39dc6b: Pushed
66afb7c3e6d1: Pushed
5fa2288e0d6e: Pushed
f4111324080c: Pushed
latest: digest: sha256:480c39c092d76b6719acbed2b7c34b77d8ff17c2562210c154d94a3b1edab6b4 size: 1775
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Here will be output from stapp02 server conosle “docker images”