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
You did not provide much information, so I will try to guess what the solution could be:
.env
file is located into that path.Few issues here:
env_file
andenvironment
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.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.$${PRIVATE_KEY}
in your command should be${PRIVATE_KEY}
(notice the single$
)solver-dev
image, determine what the entrypoint looks like, and modify the command you provide in your docker compose file.