medic / couchdb-migration

0 stars 0 forks source link

Container fails to connect to COUCHDB #13

Closed magp18 closed 1 year ago

magp18 commented 1 year ago

I am not sure if this is how it is supposed to be, but right after doing docker-compose up The image is downloaded but the container immediately exits after.

The command docker-compose run couch-migration pre-index-views <desired CHT version> then fails which I think it's because the container exited and is not in the network anymore (?)

magp18 commented 1 year ago

It was because the COUCHDB_URL was wrong, it was different since it's running inside a docker container I followed the correct answer for https://stackoverflow.com/questions/40350456/docker-any-way-to-list-open-sockets-inside-a-running-docker-container: I ran docker inspect -f '{{.State.Pid}}' container_name_or_id to get the PID of the docker container and then: sudo nsenter -t 15652 -n netstat to show me the ports that were being exposed and took the one with 5984 as COUCHDB_URL. This seems to have worked

dianabarsan commented 1 year ago

The image is downloaded but the container immediately exits after.

This is how it's supposed to work. The container will take commands and exit when the command is finished. Think of it as a cli tool, but in a docker container.

The tool needs a correct COUCHDB_URL for functioning. Depending on how you set up your network and your containers this can be different.