Jenkins Level3 - task Jenkins Build Images

Hi all,
I failed the task twice, on the other hand the pipeline is successful and the build of the image as well as the push of the image successfully

where exactly is the problem

thanks

i have the same problem

Hello, Probleme résolved
must be used Scripted pipelines instead of Declarative pipelines, because in the description of the task it insists on being a single stage

on the other hand, the declarative pipeline uses steps.

thanks

no matter what I try the task gets failed.

logs:

Started from command line by admin
[Pipeline] Start of Pipeline
[Pipeline] node
Running on app01 in /home/tony/workspace/nginx-container
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Fetching changes from the remote Git repository

git rev-parse --resolve-git-dir /home/tony/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.39.3’
git fetch --tags --force --progress – http://git.stratos.xfusioncorp.com/sarah/web.git +refs/heads/:refs/remotes/origin/ # timeout=10
Checking out Revision e05c55c17c6f80be95970137272dd4937fe5ee5e (refs/remotes/origin/master)
Commit message: “Added dockerfile”
git rev-parse refs/remotes/origin/master^{commit} # timeout=10
git config core.sparsecheckout # timeout=10
git checkout -f e05c55c17c6f80be95970137272dd4937fe5ee5e # timeout=10
git branch -a -v --no-abbrev # timeout=10
git branch -D master # timeout=10
git checkout -b master e05c55c17c6f80be95970137272dd4937fe5ee5e # timeout=10
git rev-list --no-walk e05c55c17c6f80be95970137272dd4937fe5ee5e # timeout=10
[Pipeline] sh

Step 1/2 : FROM nginx:stable-alpine3.17-slim
—> 517cf77e51a3
Step 2/2 : COPY index.html /usr/share/nginx/html/
—> ea693497474d
Successfully built ea693497474d
Successfully tagged stregi01.stratos.xfusioncorp.com:5000/nginx:latest
[Pipeline] sh

  • docker push stregi01.stratos.xfusioncorp.com:5000/nginx:latest
    The push refers to repository [stregi01.stratos.xfusioncorp.com:5000/nginx]
    19c458293d5e: Preparing
    2b60bbe779e0: Preparing
    4c6a1307a10b: Preparing
    bb0903fd6f90: Preparing
    9c01e5b3bd66: Preparing
    57b608dd7b54: Preparing
    36b50b131297: Preparing
    36b50b131297: Waiting
    57b608dd7b54: Waiting
    bb0903fd6f90: Layer already exists
    4c6a1307a10b: Layer already exists
    2b60bbe779e0: Layer already exists
    9c01e5b3bd66: Layer already exists
    57b608dd7b54: Layer already exists
    36b50b131297: Layer already exists
    19c458293d5e: Pushed
    latest: digest: sha256:6ad7d92180f6859b9c37c8f5ddcacfec7f706a36c16758296e9697d88e926c9c size: 1775
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    Finished: SUCCESS

Pipeline script:

Please suggest what can be done?

Try to install SSH Build Agents, git, Docker Pipeline, Pipeline: Job , Pipeline,Pipeline: API plugins.
And make declarative pipline:

pipeline {
    agent {
       label 'stapp1'
    }
	stages {
		stage('Build') {
		    steps {
		        script {
                    git credentialsId: 'git', url: 'http://git.stratos.xfusioncorp.com/sarah/web.git'
                    def dockerImage = docker.build('stregi01.stratos.xfusioncorp.com:5000/nginx:latest')
                    dockerImage.push()
		        }
		    }
		}
	}
}

Dont forget to make ‘git’ credentials for git repo.

Hi @awantika-kodekloud, @Tej-Singh-Rana,
I got issue with Jenkins Level3 - task Jenkins Build Images lab, same as described here, but for another lab: Level-4 "Jenkins MR Jobs" --- Validation Issue

Each time I try to build a docker image I get error:

#6 [2/2] COPY index.html /usr/share/nginx/html/
#6 ERROR: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try 'modprobe fuse' first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1
------
 > [2/2] COPY index.html /usr/share/nginx/html/:
------
Dockerfile:2
--------------------
   1 |     FROM nginx:stable-alpine3.17-slim
   2 | >>> COPY index.html /usr/share/nginx/html/
--------------------
ERROR: failed to solve: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try 'modprobe fuse' first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1

My pipeline script:

pipeline {
    agent {
       label 'stapp03'
    }
	stages {
		stage('Build') {
		    steps {
		        script {
                            git credentialsId: 'gitea', url: 'http://git.stratos.xfusioncorp.com/sarah/web.git'
                            def dockerImage = docker.build('stregi01.stratos.xfusioncorp.com:5000/nginx:latest')
                            dockerImage.push()
		        }
		    }
		}
	}
}

Please note, that I got same error if I try to build directly on the server

[root@stapp03 web]# docker build -t stregi01.stratos.xfusioncorp.com:5000/nginx:latest .
[+] Building 0.5s (6/6) FINISHED                                                        docker:default
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 109B                                                              0.0s
 => [internal] load metadata for docker.io/library/nginx:stable-alpine3.17-slim                   0.3s
 => [internal] load build context                                                                 0.0s
 => => transferring context: 57B                                                                  0.0s
 => CACHED [1/2] FROM docker.io/library/nginx:stable-alpine3.17-slim@sha256:fc1a9aa333462a071dfa  0.0s
 => ERROR [2/2] COPY index.html /usr/share/nginx/html/                                            0.1s
------
 > [2/2] COPY index.html /usr/share/nginx/html/:
------
Dockerfile:2
--------------------
   1 |     FROM nginx:stable-alpine3.17-slim
   2 | >>> COPY index.html /usr/share/nginx/html/
--------------------
ERROR: failed to solve: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try 'modprobe fuse' first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1
[root@stapp03 web]# modprobe fuse
modprobe: FATAL: Module fuse not found in directory /lib/modules/5.4.0-1106-gcp
[root@stapp03 web]#

Hi @sarhipov,
Thanks for reaching out to us. I have forwarded your concern to the KKE lab team. They will look into this. Please be patience and give us some time.

Regards,

@Tej-Singh-Rana : any update on the issue?

Hi,
To avoid the issue of docker image build

ERROR: using mount program fuse-overlayfs: unknown argument ignored: lazytime
fuse: device not found, try 'modprobe fuse' first
fuse-overlayfs: cannot mount: No such file or directory

=> don’t do any update for yum on target server :wink:
=> the command yum update change docker version and modify the Storage Driver from vfs to fuse-overlayfs




Hi,

I am facing the same issue, I tried multiple declarative pipeline however it keeps on failing.
Pipelines used:
pipeline {
agent {
label ‘stapp02’
}
stages {
stage(‘Build’) {
steps {
script {
git credentialsId: ‘git’, url: ‘http://git.stratos.xfusioncorp.com/sarah/web.git
def dockerImage = docker.build(‘stregi01.stratos.xfusioncorp.com:5000/nginx:latest’)
dockerImage.push()
}
}
}
}
}

and
pipeline {
agent {
label ‘stapp02’
}

stages {
    stage('Build') {
        steps {
            git branch: "master",
                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'
        }
    }
}

}