skip to Main Content

I am trying to use Docker Desktop to run this tutorial to install wazuh in a docker container (single-node deployment). I make a new container in the docker desktop and then try to run the docker compose command in vscode but get the error mentioned in the title. I have tried to change the project directory but it always points to the root directory by /config/certs.yml. my command is

docker-compose --project-directory /com.docker.devenvironments.code/single-node --file /com.docker.devenvironments.code/single-node/generate-indexer-certs.yml run --rm generator

my directory structure is as follows:

enter image description here

where certs.yml is in the config folder, but upon running this command the error always points to the root folder, which is not my project folder. The only folder i want to run this from is the com.docker.devenvironments.code folder, or somehow change where the command finds the certs.yml file. I have also tried cd into different folders and trying to run the command, but get the same error.

Thank you very much in advance for your help!

2

Answers


  1. Looking quickly at the documentation link provided in the question, you can try the following thing:

    Move the docker-compose definition from the folder wazuh-docker/single-node/docker-compose.yml to outer directory which is the main definition wazuh-docker in your case it will be com.docker.devenvironments.code I believe into a separate <your_compose.yaml> with the same definition, but change the volume mounts as:

    Wazuh App Copyright (C) 2021 Wazuh Inc. (License GPLv2)

    version: '3'
    
        services:
          generator:
            image: wazuh/wazuh-certs-generator:0.0.1
            hostname: wazuh-certs-generator
            volumes:
              - ./single-node/config/wazuh_indexer_ssl_certs/:/certificates/
              - ./single-node/config/certs.yml:/config/certs.yml
    ...
    

    Then, docker-compose -f <your_compose.yaml> up should do. Note: your_defined.yaml is the yaml with the volume mount changes and is created at the root of the project. Also, looking at the image provided in the question, you might want to revisit the documentation and run the command to generate the certificates docker-compose -f generate-indexer-certs.yml run --rm generator from the single-node folder.

    Login or Signup to reply.
  2. You can change the directory of the certs.yml file in the following section of the generate-indexer-certs.yml file:

    volumes:
          - ./config/certs.yml:/config/certs.yml
    You can replace ./config/certs.yml with the path where the certs.yml file is located.
    

    In your case:

    volumes:
          - /com.docker.devenvironments.code/single-node/config/certs.yml:/config/certs.yml
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search