I have a public docker image which has redis and maven. My Junit testcases access redis-server via unix domain socket. This image has been working fine on gitlab pipeline for more than 1 yr now.
Today I started setting up a pipeline on bitbucket and for some reason my tests now fail with
"Failed connecting to /var/run/redis/redis.sock"
...
Caused by: java.net.SocketException: No such file or directory
The same docker image I can pull and check locally via redis-cli that it can connect to redis-server via the same UDS.
So in a nutshell
-works on locally running docker
-works on gitlab pipeline
-does not work with bitbucket pipeline.
Does bitbucket pipeline launches these dockers in a special manner that applications do not see anything outside home directory ?
Any known work arrounds... I guess I can test with localhost:6379 but that leaves a bad taste.
Hi @kumaakh
Thank you for reaching out to the community.
Would it be possible for you to confirm if you're running your public Docker image (with the redis and maven) as a service container on Pipelines?
Or you're using it as a base Docker image?
If you're using it as a service similar to the public documentation here, I'm afraid it will only be accessible on localhost:6379.
Regards,
Mark C
Hello Mark,
redis, maven etc. are all installed on my base docker image. I am running a single main container and no service containers. If it helps here is the public image from hub.docker.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @kumaakh
Thanks for the confirmation.
I've tried pulling your public Docker image locally and I did see redis is installed in your Docker image using the redis-cli command.
In this case, would it be possible for you to debug your Pipelines build locally using your public Docker image and perform the JUnit testcases?
Ideally, if it is working locally in a non-interactive shell, it should work as well on Pipelines.
Let me know how it goes.
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mark thanks,
This was very useful... I could fix the issue by using the suggested debugging approach. I had to start the redis-server as a background process as part of the script and my tests pass now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.