i first pull an image:
docker pull ghcr.io/dbt-labs/dbt-bigquery:1.2.latest
i then try to make a container:
docker run --name dbt \
-p 8085:8085 \
-v /home/sqlboi/bigquery_bkup/:/usr/app/ \
--mount type=bind,source=/home/sqlboi/dbt_profiles/,target=/root/.dbt/ \
dbt-bigquery:1.2.latest \
init myfirstproject
couple questions:
profiles.yml
file in that dbt_profiles folder?/home/sqlboi/bigquery_bkup/dbt/
- but the container stops after it gets an error...is the container supposed to keep running for dbt even without an error? fatal: Not a dbt project (or any of the parent directories). Missing dbt_project.yml file
- but the dbt_project.yml
file can be found in /home/sqlboi/bigquery_bkup/dbt/
after it was created by init
, so how can i include a path to this?A few problems here:
The command is dbt init
, not init
. That command will create your profiles.yml for you (along with a dbt_project.yml file and some sample project files). But…
After creating the profile, dbt init
will exit with code 0, so your container will stop anyway. dbt is a CLI utility, so it might be better for you to launch an interactive shell in your container instead of running a single command. But…
dbt doesn’t do anything unless you have a project with .sql and .yml files that define your transformations. You will need to get those files into your container. And you’ll need a Dockerfile for that