Can't start mongo container as it conflicts with some other mongo service?

mongo
docker
container-image

#1

I am trying to run a docker compose that initiates a mongo service (At default port 27017) and then also a nodejs container with the repo.

I get this error ERROR: Cannot start container b484d55f3534accbfec60bae5a8a478b9ee76fc43c77e92cb3e434709ef0429e: listen tcp 0.0.0.0:27017: bind: address already in use Action failed: cd ./docker/ && docker-compose up

Seems like circleci has its own mongodb server configured? How do I disable the default one so that I can use my container instead?


#2

Hi @viztastic,

You can stop the mongodb process by adding the following to your circle.yml:

machine:
  post:
    - sudo service mongodb stop

Cheers,
Frank


#3

Hi frank, very helpful indeed. That helped me get over that problem, now I get:

ERROR: Invalid interpolation format for "volumes" option in service "mongo": "$HOME/data/:/data/db Row below uncessary as this is handled by $ docker logs." Action failed: cd ./docker/ && docker-compose up

Any thoughts? Much appreciated.


#4