Redis in Docker container with custom redis.conf file not attaching
<p>I'm having trouble getting redis to start in a docker container. when I run </p>

<pre><code>docker-compose up
</code></pre>

<p>I see the output</p>

<pre><code>Starting redis_redis_1
Attaching to redis_redis_1
redis_redis_1 exited with code 0
</code></pre>

<p>after which, I can run</p>

<pre><code>docker ps -a
</code></pre>

<p>to see
    <a href="https://i.stack.imgur.com/UtoOW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UtoOW.png" alt="docker ps -a output"></a></p>

<p>This is my docker-compose.yml</p>

<pre><code>redis:
    image: redis
    command: redis-server /usr/local/etc/redis/redis.conf
    ports:
      - "6379:6379"
    volumes:
      - /mnt/xvdb/redis/:/usr/local/etc/redis/
      - ./redis/redis.conf:/usr/local/etc/redis/redis.conf
</code></pre>

<p>This is the verbose output I get:  </p>

<pre><code>ubuntu@ip-10-0-1-172:~/redis$ docker-compose --verbose up --build
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.find_config_file: Trying paths: ['/home/ubuntu/.docker/config.json', '/home/ubuntu/.dockercfg']
docker.auth.auth.find_config_file: No config file found
compose.cli.command.get_client: docker-compose version 1.9.0, build 2585387
docker-py version: 1.10.6
CPython version: 2.7.6
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
compose.cli.command.get_client: Docker base_url: http+docker://localunixsocket
compose.cli.command.get_client: Docker version: KernelVersion=3.13.0-48-generic, Os=linux, BuildTime=2016-12-12T23:50:16.747144109+00:00, ApiVersion=1.24, Version=1.12.4, GitCommit=1564f02, Arch=amd64, GoVersion=go1.6.4
compose.cli.verbose_proxy.proxy_callable: docker info &lt;- ()
compose.cli.verbose_proxy.proxy_callable: docker info -&gt; {u'Architecture': u'x86_64',
 u'BridgeNfIp6tables': True,
 u'BridgeNfIptables': True,
 u'CPUSet': True,
 u'CPUShares': True,
 u'CgroupDriver': u'cgroupfs',
 u'ClusterAdvertise': u'',
 u'ClusterStore': u'',
 u'Containers': 1,
 u'ContainersPaused': 0,
...
compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=False, filters={u'label': [u'com.docker.compose.project=redis', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={u'label': [u'com.docker.compose.project=redis', u'com.docker.compose.service=redis', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -&gt; {u'AppArmorProfile': u'',
 u'Args': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'affinity:container==3379fa24f2ec222251f97b39f194b629841b79e85707d62ee9a922becdb0cc40',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image &lt;- ('redis')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -&gt; {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'redis-server'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={u'label': [u'com.docker.compose.project=redis', u'com.docker.compose.service=redis', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image &lt;- ('redis')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -&gt; {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'redis-server'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -&gt; {u'AppArmorProfile': u'',
 u'Args': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'affinity:container==3379fa24f2ec222251f97b39f194b629841b79e85707d62ee9a922becdb0cc40',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.parallel.feed_queue: Pending: set([&lt;Service: redis&gt;])
compose.parallel.feed_queue: Starting producer thread for &lt;Service: redis&gt;
compose.service.start_container_if_stopped: Starting redis_redis_1
compose.cli.verbose_proxy.proxy_callable: docker attach &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810', stderr=True, stream=True, stdout=True)
compose.cli.verbose_proxy.proxy_callable: docker attach -&gt; &lt;generator object frames_iter at 0x7fd372c02c80&gt;
compose.cli.verbose_proxy.proxy_callable: docker start &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810')
compose.parallel.feed_queue: Pending: set([])
compose.cli.verbose_proxy.proxy_callable: docker start -&gt; None
compose.parallel.parallel_execute_iter: Finished processing: &lt;Service: redis&gt;
compose.parallel.feed_queue: Pending: set([])
Attaching to redis_redis_1
compose.cli.verbose_proxy.proxy_callable: docker events &lt;- (decode=True, filters={u'label': [u'com.docker.compose.project=redis', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker events -&gt; &lt;generator object _stream_helper at 0x7fd372c02e60&gt;
compose.cli.verbose_proxy.proxy_callable: docker wait &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container &lt;- (u'e8617d77bbdcdd36be35a130ea7afd764a8777d0b2d4df0700a5bf708ed63810')
compose.cli.verbose_proxy.proxy_callable: docker wait -&gt; 0
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -&gt; {u'AppArmorProfile': u'',
 u'Args': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'redis-server', u'/usr/local/etc/redis/redis.conf'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'affinity:container==3379fa24f2ec222251f97b39f194b629841b79e85707d62ee9a922becdb0cc40',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
redis_redis_1 exited with code 0
</code></pre>

<p>docker logs gives me nothing</p>

<pre><code>docker logs redis_redis_1
</code></pre>

<p>gives me nothing</p>

<p><a href="https://i.stack.imgur.com/4M0tm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4M0tm.png" alt="docker logs output"></a></p>

<p>Any help appreciated</p>