Hello,
I’m new to jenkins and i’m struggling since few hours.
Here is my piece of code to push my image to my docker hub
stage('Build-Push Docker Image') {
steps {
script {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'f485db53-bb94-4b80-8711-6b453106efcc', url: 'https://gitlab.com/GoodMorrrrning/footfront.git']])
def dockerfile = 'Dockerfile'
def customImage = docker.build("vuejs-foot", "-f ${dockerfile} ./")
docker.withRegistry('', 'dockercon'){
customImage.push()
}
}
}
}
and here is the error i get :
$ docker login -u myemail.com -p ******** https://index.docker.io/v1/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /var/jenkins_home/workspace/footfront@tmp/3a8d0a39-5be0-4f3e-b7f4-e65e7bebf992/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
+ docker tag vuejs-foot vuejs-foot:latest
+ docker push vuejs-foot:latest
The push refers to repository [docker.io/library/vuejs-foot]
0a49352ca6f5: Preparing
194b12cb5e85: Preparing
2b60bbe779e0: Preparing
4c6a1307a10b: Preparing
bb0903fd6f90: Preparing
9c01e5b3bd66: Preparing
57b608dd7b54: Preparing
36b50b131297: Preparing
9c01e5b3bd66: Waiting
57b608dd7b54: Waiting
36b50b131297: Waiting
denied: requested access to the resource is denied
I cant understand why i have this error because i have succesfully logged in.
I also have tried many variation of this code, for exemple teeling a specific url like : ‘https://index.docker.io/v1/’
Thanks for helping