title: Run RabbitMQ server in Docker
body: <p>I'm getting an EOFException when connecting to the vanilla RabbitMQ Docker container. The log directory is empty /var/log/rabbitmq contains no files. The web console works without problems. It's just connecting to it that doesn't work.</p>
  
  <p>Since this is the vanilla container from the Docker Hub, I presume it's me omitting something basic. But what ? :-)</p>
  
  <p>Is there something else I can check ?</p>
  
  <hr>
  
  <p>The command to create the container:</p>
  
  <pre><code>sudo docker run -d --hostname konijn --name konijn -p 5672:5762 -p 5671:5671 -p 15672:15672 rabbitmq:3.6.6-management
  </code></pre>
  
  <p>It shows up as running:</p>
  
  <pre><code>$ sudo docker ps
  CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                                                                                NAMES
  0a62c2635d17        rabbitmq:3.6.6-management   "docker-entrypoint.sh"   12 seconds ago      Up 10 seconds       4369/tcp, 5672/tcp, 0.0.0.0:5671-&gt;5671/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672-&gt;15672/tcp, 0.0.0.0:5672-&gt;5762/tcp   konijn
  </code></pre>
  
  <p>When running this code sample:</p>
  
  <pre><code>  @Test
    public void testUnprotectedConnection() throws Exception {
      final ConnectionFactory factory = new ConnectionFactory();
      factory.setUri("amqp://guest:guest@localhost:5672/");
      Connection conn = factory.newConnection();
    }
  </code></pre>
  
  <p>I'm getting:</p>
  
  <pre><code>java.io.IOException
      at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105)
      at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:353)
      at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:62)
      at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:99)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:900)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:817)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:954)
      at com.enervalis.messaging.rabbitmq.RabbitMQCertificateTest.testUnprotectedConnection(RabbitMQCertificateTest.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
      at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
      at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
      at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
      at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
      at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
      at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
      at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:372)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:297)
      ... 30 more
  Caused by: java.io.EOFException
      at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
      at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
      at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
      at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:571)
      ... 1 more
  </code></pre>
  
  <p>The container's log files are missing:</p>
  
  <pre><code>$ sudo docker exec konijn ls -l /var/log/rabbitmq
  total 0
  </code></pre>
  
  <p>The docker version information:</p>
  
  <pre><code>$ sudo docker version
  Client:
   Version:      1.13.0
   API version:  1.25
   Go version:   go1.7.3
   Git commit:   49bf474
   Built:        Tue Jan 17 10:05:19 2017
   OS/Arch:      linux/amd64
  
  Server:
   Version:      1.13.0
   API version:  1.25 (minimum version 1.12)
   Go version:   go1.7.3
   Git commit:   49bf474
   Built:        Tue Jan 17 10:05:19 2017
   OS/Arch:      linux/amd64
   Experimental: false
  </code></pre>
  
  <p>System information:</p>
  
  <pre><code>XUbuntu 16.10, amd64
  
  $ uname -a
  Linux black 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  
  $ cat /etc/issue
  Ubuntu 16.10
  </code></pre>