简体   繁体   中英

Docker & Graylog

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 :

在此输入图像描述

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM