I am running jenkins instance on AWS - ubuntu. As a part of the build process, I need to create docker image. while pipeline sh script is running command docker build -t ${dockerImageName} ./
it throws error with open permission denied.
I have verified that user is jenkins
and file permission for .dockerignore is -rw-r--r--
I have find that docker command was not having enough permissions to execute this command. Then I found that it happen when we install docker using snap. I uninstalled it and then install it using apt-get. Then in Jenkin pipeline , I updated my $PATH variable to give location of my docker command. And it worked like a charm.