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

Deploying the basic image using docker desktop #275

Open
cj19 opened this issue Sep 24, 2024 · 6 comments
Open

Deploying the basic image using docker desktop #275

cj19 opened this issue Sep 24, 2024 · 6 comments
Labels
question Further information is requested Stale

Comments

@cj19
Copy link

cj19 commented Sep 24, 2024

Describe the bug

I am trying to run the image using docker desktop, but after I set the env variables I get this error:

panic: open C:\DevEnv\mongodb-query-exporter\config.yaml: no such file or directory

I am running the docker desktop on windows. Does not matter what i set into the config path, i get this type of error.

To Reproduce

Start the image on windows 10?

Expected behavior

The docker starts properly.

Environment

  • mongodb-query-exporter version: [e.g. v1.0.0]
  • windows 10
  • MongoDB version: [e.g. v5.0.0]
  • Deployed as: [e.g. docker,kubernetes,binary]
@cj19 cj19 added the bug Something isn't working label Sep 24, 2024
@raffis
Copy link
Owner

raffis commented Sep 24, 2024

Please clarify how you start the container. Are you actually mounting the config?

@cj19
Copy link
Author

cj19 commented Sep 24, 2024

well, i adapted my compose file a bit:

version: '3.8'

services:
  mongodb-query-exporter:
    image: raffis/mongodb-query-exporter:latest
    container_name: mongodb-query-exporter
    environment:
      - MY_USERNAME=mongodb_query_exporter
      - MY_PASSWORD=xxxx
      - MDBEXPORTER_MONGODB_URI=mongodb://${MY_USERNAME}:${MY_PASSWORD}@localhost:27017
      - MDBEXPORTER_CONFIG=/config/config.yml
      - PATH=/usr/local/bin:/config/bin
      - SSL_CERT_FILE=/config/ssl/cert.crt
    volumes:
      - C:\DevEnv\mongodb-query-exporter\config.yml:/config/config.yaml
      - C:\DevEnv\mongodb-query-exporter\bin:/config/bin
      - C:\DevEnv\mongodb-query-exporter\ssl:/config/ssl
    ports:
      - "9216:9216"

I am not sure about the MDBEXPORTER_CONFIG, PATH, SSL_CERT_FILE. Do I need to change the values or they can have the default config values?
Also i am using the default config values from the readme file and the new error I receive at startup is:

time="2024-09-24T16:27:45+02:00" level=warning msg="C:\\DevEnv\\mongodb-query-exporter\\docker-compose.yml: `version` is obsolete"
[+] Running 1/1
 ✘ mongodb-query-exporter Error manifest for raffis/mongodb-query-exporter:latest not found: manifest unknown: manifest unknown                                                                                                                                                                                                                                       1.6s
Error response from daemon: manifest for raffis/mongodb-query-exporter:latest not found: manifest unknown: manifest unknown

@raffis
Copy link
Owner

raffis commented Sep 24, 2024

Your MDBEXPORTER_CONFIG points to /config/config.yml while you're mounting it to /config/config.yaml

@cj19
Copy link
Author

cj19 commented Sep 24, 2024

I changed every file extension to yml and i still get the same error.

@raffis
Copy link
Owner

raffis commented Sep 24, 2024

I doubt this relates to the exporter, you are rather have an error somewhere.
pls check if C:\DevEnv\mongodb-query-exporter\config.yml actually exists. Also mounting the bin directory makes no sense.
Also pls post the exporter config.

If things still not work try start an ubuntu container with the same settings start a shell and execute cat /config/config.yaml to actually make sure everything else is fine.

@cj19
Copy link
Author

cj19 commented Sep 24, 2024

yeah, it is more like a discussion now, but I would like to understand what I am doing wrong.

Which is the easiest way to run the docker image on windows with the environments listed above?

@raffis raffis added question Further information is requested and removed bug Something isn't working labels Sep 25, 2024
@github-actions github-actions bot added the Stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants