Hi…I am running my Jenkins job on windows os. I am building war file on slave node which is in AWS- ubuntu 18.07 server. My Docker is installed on my slave node. My Docker file is in workspace. But while building the image I am facing error:
I have already added my slave node user to Docker group & inside slave node workspace (ubuntu server) , I am able to create same image without using sudo.
docker build -t swagats/helloimage .
But still I am facing the error in Jenkins. Please help me.
[slaveAnsibleDocker] $ docker build -t swagats/helloimage --pull=true /home/ubuntu/workspace/slaveAnsibleDocker 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.39/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&pull=1&rm=1&session=utpwhi2ue7xox69p9mibabkb7&shmsize=0&t=swagats%2Fhelloimage&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied Build step ‘Docker Build and Publish’ marked build as failure
Finished: FAILURE