title: Prometheus not running on the vm but runs on Docker locally
body: <p>I'm trying to get prometheus running on the vm. I have several microservices which I wish to monitor and are running on the vm. I added the below to one of the docker-compose.yml files :</p>
  
  <pre><code>prometheus:
      image: prom/prometheus:v2.1.0
      volumes:
          - ./prometheus.yml:/etc/prometheus/prometheus.yml
      command:
          - '--config.file=/etc/prometheus/prometheus.yml'
      ports:
          - '9090:9090'
  </code></pre>
  
  <p>And I added my prometheus.yml file in the same folder as the above docker-compose.</p>
  
  <pre><code>global:
    scrape_interval:     15s 
    evaluation_interval: 15s 
  
  
  
  scrape_configs:
  
    - job_name: 'prometheus'
  
      static_configs:
          - targets: ['localhost:9090']
  
   - job_name: 'radios-service'
  
  
     metrics_path: '/prometheus-metrics'
     static_configs:
          - targets: ['radios-service:8080']
  
   - job_name: 'websocket-service'
     metrics_path: '/prometheus-websocket'
     static_configs:
        - targets: ['websocket-service:8080']
  </code></pre>
  
  <p>This runs successfully on docker through my command line.However, it throws this error when i try to run it on the vm:</p>
  
  <blockquote>
    <p>ERROR: for prometheus Cannot start service prometheus: b'OCI runtime
    create failed: container_linux.go:348: starting container process
    caused "process_linux.go:402: container init caused
    \"rootfs_linux.go:58: mounting \\"/usr/local/bin/prometheus.yml\\"
    to rootfs
    \\"/var/lib/docker/overlay2/f4b34c5866b191683d4e8c08e59fb14f56127cbcd67a603225954dd59c0a6a50/merged\\"
    at
    \\"/var/lib/docker/overlay2/f4b34c5866b191683d4e8c08e59fb14f56127cbcd67a603225954dd59c0a6a50/merged/etc/prometheus/prometheus.yml\\"
    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' ERROR: Encountered errors while
    bringing up the project.</p>
  </blockquote>
  
  <p>But it does not throw any issue when i run it locally. What could the issue in the vm be?</p>