title: Testing Mongo with Docker
body: <p>given the following file for docker-compose </p>
  
  <pre><code>version: '2'
  services:
    sut:
      build: .
      command: /bin/bash  #nosetests
      depends_on:
       - mongo
    mongo:
      image: mongo
  </code></pre>
  
  <p>I try to connect to a mongo server on the fly. I didn't get very far with this ambitious plan. I assume the server the Mongo server is running with the docker container (named sut), e.g. I could address directly from Python with</p>
  
  <pre><code>MongoClient(host="localhost", port=27017)
  </code></pre>
  
  <p>Unfortunately I face problems to fire the above docker-compose up, e.g.:</p>
  
  <pre><code>thomas@linuxclientlobnek01:~/github/pydata$ docker-compose -f docker-compose.test.yml up
  Starting pydata_mongo_1
  Recreating pydata_sut_1
  Attaching to pydata_mongo_1, pydata_sut_1
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=cdaf9f862a16
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] db version v3.2.8
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] git version: ed70e33130c977bda0024c125b56d159573dbaf0
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] allocator: tcmalloc
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] modules: none
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] build environment:
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten]     distmod: debian71
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten]     distarch: x86_64
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten]     target_arch: x86_64
  mongo_1  | 2016-07-18T10:17:03.967+0000 I CONTROL  [initandlisten] options: {}
  mongo_1  | 2016-07-18T10:17:03.976+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
  mongo_1  | 2016-07-18T10:17:03.976+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=8G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] 
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] 
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
  mongo_1  | 2016-07-18T10:17:04.076+0000 I CONTROL  [initandlisten] 
  mongo_1  | 2016-07-18T10:17:04.076+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
  mongo_1  | 2016-07-18T10:17:04.076+0000 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
  mongo_1  | 2016-07-18T10:17:04.077+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
  pydata_sut_1 exited with code 0
  </code></pre>
  
  <p>Any comments are very appreciated... </p>