Jenkins pipeline throwing error. "open ./dockerignore permission denied

2/20/2019

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--

-- mhdnp1234
amazon-ec2
docker
jenkins
jenkins-pipeline
kubernetes

1 Answer

2/22/2019

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.

-- mhdnp1234
Source: StackOverflow