Skip to content

Issue when trying to mount prometheus/prometheus.yaml to /etc/ #2621

@DjNaGuRo

Description

@DjNaGuRo

When I execute this code to install prometheus using docker :

# Create persistent volume for your data
docker volume create prometheus-data
# Start Prometheus container
docker run \
    -d \
    --name prometheus \
    --restart always \
    -p 9090:9090 \
    -v /prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
    -v prometheus-data:/prometheus \
    prom/prometheus

I got the following error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/prometheus/prometheus.yml" to rootfs at "/etc/prometheus/prometheus.yml": create mountpoint for /etc/prometheus/prometheus.yml mount: cannot create subdirectories in "/var/lib/docker/overlay2/2e485672e2ca0e92b67c42514c2d632dfc807ea0d0d2eb1db1da6b5d1b1bed6f/merged/etc/prometheus/prometheus.yml": 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

I've followed this documentation instruction

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportUser questions/support requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions