Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial on https://vector.dev/docs/setup/installation/platforms/docker/ failed #5410

Closed
jerryleooo opened this issue Dec 5, 2020 · 5 comments
Labels
domain: external docs Anything related to Vector's external, public documentation platform: docker Anything `docker` platform related

Comments

@jerryleooo
Copy link

The tutorial on:

https://vector.dev/docs/setup/installation/platforms/docker/

Here's what went wrong:

$ docker run \                                                                                                                                                    [13:32:55]
  -v ~/vector.toml:/etc/vector/vector.toml:ro \
  -p 8383:8383 \
  timberio/vector:0.11.X-alpine
Dec 05 06:20:45.621  INFO vector::app: Log level is enabled. level="vector=info,codec=info,file_source=info,tower_limit=trace,rdkafka=info"
Dec 05 06:20:45.621  INFO vector::app: Loading configs. path=[("/etc/vector/vector.toml", Some(TOML))]
Dec 05 06:20:45.626  INFO vector::sources::docker_logs: Capturing logs from now on. now=2020-12-05T06:20:45.626290469+00:00
Dec 05 06:20:45.626  INFO vector::sources::docker_logs: Listening to docker log events.
Dec 05 06:20:45.626  INFO vector::topology: Running healthchecks.
Dec 05 06:20:45.626  INFO vector::topology: Starting source. name="logs"
Dec 05 06:20:45.626  INFO vector::topology: Starting sink. name="out"
Dec 05 06:20:45.627  INFO vector: Vector has started. version="0.11.0" git_version="v0.11.0" released="Wed, 02 Dec 2020 03:06:57 +0000" arch="x86_64"
Dec 05 06:20:45.626  INFO vector::topology::builder: Healthcheck: Passed.
Dec 05 06:20:45.627  INFO vector::app: API is disabled, enable by setting `api.enabled` to `true` and use commands like `vector top`.
Dec 05 06:20:45.628 ERROR source{component_kind="source" component_name=logs component_type=docker_logs}: vector::sources::docker_logs: Listing currently running containers failed. error=error trying to connect: No such file or directory (os error 2)
Dec 05 06:20:45.628  INFO vector::shutdown: All sources have finished.
Dec 05 06:20:45.628  INFO vector: Vector has stopped.
@jamtur01
Copy link
Contributor

jamtur01 commented Dec 5, 2020

The problem here is that the docker_logs source inside a container doesn't have permissions to read the Docker/Containerd socket or use the daemon API. You need to run Docker something like so:

docker run                                                                                                                                               
  -v ~/vector.toml:/etc/vector/vector.toml:ro \
  -v /run/containerd/containerd.sock:/run/containerd/containerd.sock \
  -e DOCKER_HOST="unix:///run/containerd/containerd.sock" \
  -p 8383:8383 \
  timberio/vector:0.11.X-alpine

@jamtur01 jamtur01 added platform: docker Anything `docker` platform related source: docker labels Dec 5, 2020
@jszwedko jszwedko added the domain: external docs Anything related to Vector's external, public documentation label Mar 18, 2021
@JoseIbanez
Copy link

JoseIbanez commented May 6, 2021

This works for my (ubuntu vm):

docker run -d \
    -v ~/vector.toml:/etc/vector/vector.toml:ro \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e DOCKER_HOST="unix:///var/run/docker.sock" \
    -p 8383:8383 timberio/vector:0.13.X-debian

Try docker.sock vs containerd.sock

@DmitriyPanteleev
Copy link

Thanks JoseIbanez. Your snippet works for me. Ubuntu 20.04.

@jszwedko
Copy link
Member

jszwedko commented Aug 5, 2022

Closing since the socket needs to be mounted, as noted above, for the docker_logs source to work in the container.

@jszwedko jszwedko closed this as completed Aug 5, 2022
@lddlww
Copy link

lddlww commented Nov 15, 2024

so, vector does not support containerd.sock? if runtime is containerd not docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation platform: docker Anything `docker` platform related
Projects
None yet
Development

No branches or pull requests

6 participants