5

I've been installing the last version of Docker (1.8). This new version is great because you can set a particular log-driver to send the log to Graylog2 (for example).

Here's the blog post from docker : Docker Blog announcing 1.8 Here's the graylog team blog to make the magic happen : Graylog blog

My problem is that it doesn't work :(

Here is the error message I get when I lauch this command :

docker run –log-driver=gelf –log-opt gelf-address=udp://127.0.0.1:12201 busybox echo Hello Graylog 

Error :

Unable to find image '–log-driver=gelf:latest' locally repository name component must match "[a-z0-9]+(?:[._-][a-z0-9]+)*"

Here's an screenshot :

enter image description here

Any idea ?

EDIT

Following the advices of smart people : It looks like the dash was not the good one.

Here's a paste of the correct command :

docker run --log-driver=gelf --log-opt gelf-address=udp://127.0.0.1:12201 busybox echo Hello Graylog
Mathieu
  • 365
  • 2
  • 9

1 Answers1

4

You need to write two dashes instead a single one: ... --log-driver=gelf --log-opt ...

EDIT: In that blogpost it is written:

The Docker plugins mechanism is now available in the new Docker experimental channel.

You need to install the experimental docker version like:

curl -sSL https://experimental.docker.com/ | sh
Henrik Sachse
  • 51,228
  • 7
  • 46
  • 59
  • What does `docker version` say? – Henrik Sachse Aug 12 '15 at 19:24
  • Client: Version: 1.8.0 API version: 1.20 Go version: go1.4.2 Git commit: 0d03096 Built: Tue Aug 11 16:48:39 UTC 2015 OS/Arch: linux/amd64 Server: Version: 1.8.0 API version: 1.20 Go version: go1.4.2 Git commit: 0d03096 Built: Tue Aug 11 16:48:39 UTC 2015 OS/Arch: linux/amd64 – Mathieu Aug 12 '15 at 19:26
  • You need to install the experimental version. I updated my answer accordingly. – Henrik Sachse Aug 12 '15 at 19:29
  • Unfortunately, no. I'm now in 1.9.0-dev and I still get the same message. – Mathieu Aug 12 '15 at 19:34
  • BTW : Thank you very much for your help ! – Mathieu Aug 12 '15 at 19:35
  • 1
    It should be in the stable release, but the problem is you need two dashes and @h3nrik suggests. Also, I'm not sure if that IP will work, you may need to use the IP of the host. – Adrian Mouat Aug 12 '15 at 19:38
  • There is no way you will get the same error if you use `--`; it should say ` no log driver named 'gelf' is registered` if the driver isn't present. – Adrian Mouat Aug 12 '15 at 19:43
  • Well... I do, I just added a screenshot so that you trust me ;) – Mathieu Aug 12 '15 at 19:54
  • Can you please do that again with a cut and paste rather than a screenshot? Unless you're using the wrong sort of dash, this seems very strange. – Adrian Mouat Aug 12 '15 at 20:18
  • 1
    Yeah, you're using the wrong kind of dash :) Cut and paste the text from @h3nrik's answer and you'll see what I mean. You can even the see the difference in the question, compare the dash in the middle of the word to the dash at the start. – Adrian Mouat Aug 12 '15 at 20:20
  • @AdrianMouat Wooow ! I'm impressed... did not even know there was 2 sorts of dash ! BRAVO ! – Mathieu Aug 12 '15 at 20:47