Install Vector on Docker

Docker is an open platform for developing, shipping, and running applications and services. Docker enables you to separate your services from your infrastructure so you can ship quickly. With Docker, you can manage your infrastructure in the same ways you manage your services. By taking advantage of Docker's methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production. This page will cover installing and managing Vector on the Docker platform.

Install

0.11.X
debian
Vector daemon deployment strategyVector daemon deployment strategy
1. Your service logs to STDOUT
STDOUT follows the 12 factor principles.
2. STDOUT is captured
STDOUT is captured by your platform.
3. Vector collects & fans-out data
Vector collects data from your platform.

The agent role is designed to collect all Docker data on a single host. Vector runs in its own container interfacing with the Docker Engine API for log via the docker_logs source and metrics via the host_metrics source, but it is recommended to adjust your pipeline as necessary using Vector's sources, transforms, and sinks.


  1. Configure Vector

    cat <<-'VECTORCFG' > ~/vector.toml
    # Vector's API for introspection
    [api]
    enabled = true
    address = "127.0.0.1:8686"
    # Host-level logs
    [sources.logs]
    type = "docker_logs"
    # --> Add transforms here to parse, enrich, and process data
    # print all events, replace this with your desired sink(s)
    # https://vector.dev/docs/reference/sinks/
    [sinks.out]
    type = "console"
    inputs = [ "logs" ]
    encoding.codec = "json"
    VECTORCFG
  2. Start Vector

    docker run \
    -d \
    -v ~/vector.toml:/etc/vector/vector.toml:ro \
    -p 8383:8383 \
    timberio/vector:0.11.X-debian
  3. Observe Vector

    docker logs -f $(docker ps -aqf "name=vector")
    explain this command

Deployment

Vector is an end-to-end observability data platform designed to deploy under various roles. You mix and match these roles to create topologies. The intent is to make Vector as flexible as possible, allowing you to fluidly integrate Vector into your infrastructure over time. The deployment section demonstrates common Vector topologies:

Common Deployment Topologies

Administration

0.11.X
debian

Start

docker run \
-d \
-v ~/vector.toml:/etc/vector/vector.toml:ro \
-p 8383:8383 \
timberio/vector:0.11.X-debian
explain this command

Stop

docker stop timberio/vector
explain this command

Reload

docker kill --signal=HUP timberio/vector
explain this command

Restart

docker restart -f $(docker ps -aqf "name=vector")
explain this command

Observe

docker logs -f $(docker ps -aqf "name=vector")
explain this command

Uninstall

0.11.X
debian
docker rm timberio/vector timberio/vector
explain this command