skip to Main Content

I have the following docker compose file

version: "3.8"

services:
  local-dev:
    image: solver-dev
    container_name: local-dev
    environment:
      - RUST_LOG=khalani_solver=debug
    command: "local-dev-env"

  intent_book_matchmaker:
    image: solver-dev
    container_name: intent_book_matchmaker
    depends_on:
      - local-dev
    env_file:
      - .env
    environment:
      - PRIVATE_KEY=${PRIVATE_KEY}
      - CONFIG_FILE=/config/with-local.json
      - SEPOLIA_RPC_URL=${SEPOLIA_RPC_URL}
      - SEPOLIA_WS_URL=${SEPOLIA_WS_URL}
      - FUJI_RPC_URL=${FUJI_RPC_URL}
      - FUJI_WS_URL=${FUJI_WS_URL}
      - RUST_LOG=khalani_solver=debug,intentbook-matchmaker=debug
    command: intentbook-matchmaker --private-key $${PRIVATE_KEY} --config-file /config/with-local.json

these flags are required by the application to run. I have these in my .env flag.

unfortunately , when i run the container, i keep getting this error.

intent_book_matchmaker | error: the following required arguments were not provided:
intent_book_matchmaker | –config-file <CONFIG_FILE>
intent_book_matchmaker |
intent_book_matchmaker | Usage: intentbook-matchmaker –config-file <CONFIG_FILE>
intent_book_matchmaker |
intent_book_matchmaker | For more information, try ‘–help’.

I would appreciate pointers on this

2

Answers


  1. You did not provide much information, so I will try to guess what the solution could be:

    1. Explicitly declare then context path ( https://docs.docker.com/compose/compose-file/build/#context ).
    2. Check that the .env file is located into that path.
    Login or Signup to reply.
  2. Few issues here:

    1. You have both env_file and environment declared. According to the documentation, if you use both the env_file and environment attribute, environment variables set by environment take precedence. I would recommend choosing one method over another, for consistency.
    2. CONFIG_FILE seems to be set to a hardcoded path. If that is the case, probably doesn’t need to be set as an environmental variable.
    3. $${PRIVATE_KEY} in your command should be ${PRIVATE_KEY} (notice the single $)
    4. And to the root of the problem, it seems that the container image you are using already has an entrypoint configured, so the command argument is being appended to the contents of the entrypoint. You will need to inspect the solver-dev image, determine what the entrypoint looks like, and modify the command you provide in your docker compose file.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search