Metricbeat Docker didn't work with `system.hostfs`
m0nhawk opened this issue ยท 4 comments
The Metricbeat Docker didn't work with system.hostfs
:
docker run -it -e ELASTICSEARCH_URL=http://elasticsearch:9200 -v=/proc:/hostfs/proc:ro -v=/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro -v=/:/hostfs:ro docker.elastic.co/beats/metricbeat:5.3.0 -system.hostfs=/hostfs
Error:
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"-system.hostfs=/hostfs\": stat -system.hostfs=/hostfs: no such file or directory".
The Dockerfile defines a CMD
rather than an ENTRYPOINT
. So by specifying arguments you are overriding the default CMD
. So in effect you are attempting to execute -system.hostfs=/hostfs
.
Change your command to be metricbeat -e -system.hostfs=/hostfs
.
Having said that, we will likely switch to the ENTRYPOINT
style with a later release.
@andrewkroh Thanks! I've just take this from official documentation: from here.
Thanks again, with full command everything works.
Good catch on the docs. I think they were written for a generic image that existed before these official ones. Complete documentation for these images is in the backlog.
I'll raise an issue to switch to ENTRYPOINT
since it's (IMO) elegant, and largely expected in the Docker community these days.