Hi Guys,
I have a problem with integration of docker and jenkins. In Devsecops course section “Demo - Docker Build and Push” it doesnt explain how to create a webhook to push the code from github to dockerhub. I created it manually but i dont know if it works or not. I create a new repository called “numeric-app” and use my dockerhub sh docker build -t username/numeric-app:“”$GIT_COMMIT"" .’ and sh docker push username/numeric-app:“”$GIT_COMMIT"" .’ . After that i create a new credentials for docker-hub using my dockerhub username and password. When i build now on jenkins the build history and console ouptut error shown like this:
docker login -u username -p ******** https://index.docker.io/v1/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/auth”: dial unix /var/run/docker.sock: connect: permission denied
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: docker login failed
Finished: FAILURE
How to solve this? Thank you. Right now i learn and following devsecops course.