Skip to content

Telegraf error in container creation #57

@hepelayo

Description

@hepelayo

Hi @gcgarner, what a great job!!

When creating the Telegraf container, an error occurs when mounting volumes:

ERROR: for telegraf Cannot start service telegraf: b'OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/home/pi/IOTstack/services/telegraf/telegraf.conf\\\\\\" to rootfs \\\\\\"/var/lib/docker/overlay2/391d10a5f71b6968d5917f777ed56d92e1561f8db14d4c319c3fff27aaa439d9/merged\\\\\\" at \\\\\\"/var/lib/docker/overlay2/391d10a5f71b6968d5917f777ed56d92e1561f8db14d4c319c3fff27aaa439d9/merged/etc/telegraf/telegraf.conf\\\\\\" caused \\\\\\"not a directory\\\\\\"\\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type'

In my case, the error disappears if I map the directory ./services/telegraf in the volumes section of the service in docker compese.yml

The Telegraf service at docker-compose.yml would be:

telegraf:
    container_name: telegraf
    image: telegraf
    volumes:
      - ./services/telegraf:/etc/telegraf
      - ./services/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    depends_on:
      - influxdb
      - mosquitto

Thanks for your effort,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions