I’m writing a Java app that will be responsible for doing some work and persisting that work to the database. The app is using CouchbaseLite 2.7.0 for Linux.
If I run the app from the IDE or run the executable directly from the command line, everything works fine. When I build the Docker image and run it inside a Docker container, however, it gets stuck at the point where the replicator attempts to connect to the endpoint, as can be seen by the following output:
I/CouchbaseLite/REPLICATOR:Replicator{@450b4ee,<-,Database{@247240e5, name=’[redacted]’},URLEndpoint{url=wss://[redacted]:443/data}]: status changed: (0, 0) @C4ReplicatorStatus{level=2, completed=0, total=0, #docs=0, domain=0, code=0, info=0}
I/CouchbaseLite/REPLICATOR:Replicator{@450b4ee,<-,Database{@247240e5, name=’[redacted]’},URLEndpoint{url=wss://[redacted]:443/data}] is connecting, progress 0/0, error: null
After this, nothing happens – no replicator status update or anything. And this is run with verbose logging turned on. Furthermore, HTTP requests work, because prior to starting up the replicator, the app creates a session with our cloud backend using an HTTP request, so the issue appears to be related to websockets.
We already have our Sync Gateway infrastructure set up and working with our other product lines. This app’s purpose is to perform some jobs as requested by the web app (or potentially other clients), persist that work to the database, and then close.
Is there any reason why the replicator can’t seem to connect from inside a Docker container?