Jenkins in a docker container issue

Hi All, I got the following error “java.lang.NullPointerException: Cannot invoke “String.equals(Object)” because the return value of “com.amazonaws.AmazonServiceException.getErrorCode()” is null” when i moved jenkins from ec2 instance to a docker container . please help as i am new to jenkins and docker

You have something in your jobs or jenkins config that expects to use some AWS services (probably with ec2-auth), so that fails if you move it to a docker container.

I am sorry but do i need to install some aws services such as aws cli in the image? by the way thanks

Or better still, do you know the best way to move a running jenkins on ec2 instance to a docker container without loosing data

That depends…

I suspect that the setup expects to run only inside an ec2 instance. So you should find out where it uses aws services and remove those for the docker setup.

Ok i will look at the setup and check for any aws dependencies … Thank you very much

Still struggling with this error. Don’t know where to look

Have you verified aws related plugins and their configurations in jenkins

Don’t know where to look