英文:
Environmental variables and folder locations - Docker & Git Bash
问题
我尝试在Windows上使用Git Bash运行Docker容器(https://metriql.com/metriql-cli/cli-overview/):
export DBT_PROJECT_DIR=${PWD};
export DBT_PROFILES_DIR=${HOME}/.dbt;
export METRIQL_PORT=5656;
docker run -it -p "${METRIQL_PORT}:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql serve
但是,我收到错误消息:“profiles.yml不存在于/C:/Users/katep/.dbt/profiles.yml中。请设置--profiles-dir选项。”
所以,我更改为:
export DBT_PROJECT_DIR=${PWD};
export DBT_PROFILES_DIR=${HOME}/.dbt;
export METRIQL_PORT=5656;
docker run -p "${METRIQL_PORT}:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql serve --project-dir "C:/Users/katep/OneDrive/Documents/redshift/metriql" --profiles-dir "C:/Users/katep/.dbt/"
--manifest-json file:C:/Users/katep/OneDrive/Documents/redshift/metriql/target/manifest.json
我仍然遇到相同的错误。我猜测我可能错误地分配了环境变量。我做错了什么?
英文:
I am trying to run a docker container (https://metriql.com/metriql-cli/cli-overview/ using Git Bash on Windows:
export DBT_PROJECT_DIR=${PWD};
export DBT_PROFILES_DIR=${HOME}/.dbt;
export METRIQL_PORT=5656;
docker run -it -p "${METRIQL_PORT}:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql serve
However, I was getting the error ' profiles.yml does not exist in /C:/Users/katep/.dbt/profiles.yml. Please set --profiles-dir option.'
So, I changed to:
export DBT_PROJECT_DIR=${PWD};
export DBT_PROFILES_DIR=${HOME}/.dbt;
export METRIQL_PORT=5656;
docker run -p "${METRIQL_PORT}:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql serve --project-dir "C:/Users/katep/OneDrive/Documents/redshift/metriql" --profiles-dir "C:/Users/katep/.dbt/"
--manifest-json file:C:/Users/katep/OneDrive/Documents/redshift/metriql/target/manifest.json
I continue getting the same error. My assumption is that I am assigning environmental variables incorrectly. What am I doing wrong?
答案1
得分: 1
已解决。正确的命令是:
docker run -it -p "${METRIQL_PORT}:5656" -v "/${DBT_PROJECT_DIR}://root/app" -v "/${DBT_PROFILES_DIR}://root/dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=//root/app buremba/metriql serve
英文:
Resolved. The correct command is:
docker run -it -p "${METRIQL_PORT}:5656" -v "/${DBT_PROJECT_DIR}://root/app" -v "/${DBT_PROFILES_DIR}://root/dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=//root/app buremba/metriql serve
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论