1

I have a docker-compose file with RabbitMQ, PostgresSQL and Vault to run, for this Vault container I have some configurations and a .sh file to apply these configurations, but when I run the compose file, I get an error from Vault container: " /usr/local/bin/docker-entrypoint.sh: exec: line 104: /vault/config/config.sh: not found"

I'm using Windows 10 PRO I already tried:

And nothing seems to work...

My docker file:

version: "3"

services:

  postgres:
    container_name: postgres
    image: postgres:9.6
    ports:
      - "5433:5432"
    environment:
      POSTGRES_USER: <my_user>
      POSTGRES_PASSWORD: <my_pass>
      POSTGRES_DB: <my_db>
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U <my_db>"]
      interval: 2s
      timeout: 3s
      retries: 30

  rabbit:
    container_name: rabbit
    image: rabbitmq:3-management
    ports:
      - "5673:5672"
      - "15673:15672"
    healthcheck:
      test: ["CMD", "rabbitmqctl", "node_health_check"]
      interval: 2s
      timeout: 3s
      retries: 30

  vault:
    container_name: vault
    image: vault
    ports:
      - "8201:8200"
    volumes:
      - ./vault/:/vault/config
    environment:
      VAULT_ADDR: http://0.0.0.0:8200
      VAULT_DEV_ROOT_TOKEN_ID: root
      SKIP_SETCAP: 1
    links:
      - postgres
      - rabbit
    command: ["/vault/config/config.sh"]
    healthcheck:
      test: ["CMD", "vault", "status"]
      interval: 2s
      timeout: 3s
      retries: 30

On Linux it's running ok, the problem is on Windows If anyone needs more content (files, context, code, etc) comment and I will add it.

Javarian
  • 127
  • 2
  • 13
  • I am assuming the `config.sh` does exist in that location? If so, are the line endings `LF`? – dustytrash Oct 28 '19 at 15:32
  • Yes, the folder "vault" exists in the same directory as the docker compose file, and I saved the file with CRLF and LF – Javarian Oct 28 '19 at 15:34
  • @dustytrash Try changing `command: ["/vault/config/config.sh"]` to `command: tail -F anything` which just runs the container forever, then use `docker exec -it vault /bin/sh` to launch a shell in the running container [(see this)](https://stackoverflow.com/a/45450456/2052575). Then try to run `/vault/config/config.sh` from the shell inside the container to debug further. – v25 Oct 28 '19 at 18:17
  • Along with the above, try doing an `inspect` on the container to see if any volumes exist for the location – dustytrash Oct 28 '19 at 18:46
  • The files exists inside the container, but if I'm not in the config folder, even executing docker exec -it vault /bin/sh, I get the same error. – Javarian Oct 30 '19 at 11:12

0 Answers0