The problem I’m having
Trying to run dbt using a docker image, which keeps throwing a “dbt_snowflake://macros/adapters.sql” error
dbt=1.9.1
Registered adapter: snowflake=1.9.0
This is a very simple project with one model, which works locally (vscode).
The context of why I’m trying to do this
Attempting to get a working docker image and configuration, on top of which I can build a project
What I’ve already tried
I’ve tried multiple python version (3.9 - 3.13, slim and regular)
I’ve tried a few different approaches to the dockerfile. Below are some examples.
Some example code or error messages
Full error below:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 153, in wrapper
result, success = func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 103, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 235, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 264, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 311, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 327, in wrapper
setup_manifest(ctx, write=write, write_perf_info=write_perf_info)
File "/usr/local/lib/python3.9/site-packages/dbt/cli/requires.py", line 351, in setup_manifest
ctx.obj["manifest"] = parse_manifest(
File "/usr/local/lib/python3.9/site-packages/dbt/parser/manifest.py", line 2061, in parse_manifest
manifest = ManifestLoader.get_full_manifest(
File "/usr/local/lib/python3.9/site-packages/dbt/parser/manifest.py", line 312, in get_full_manifest
manifest = loader.load()
File "/usr/local/lib/python3.9/site-packages/dbt/parser/manifest.py", line 381, in load
self.load_and_parse_macros(project_parser_files)
File "/usr/local/lib/python3.9/site-packages/dbt/parser/manifest.py", line 682, in load_and_parse_macros
block = FileBlock(self.manifest.files[file_id])
KeyError: 'dbt_snowflake://macros/adapters.sql'
Dockerfile:
# Use a base image with Python and necessary dependencies
FROM python:3.9-slim
# Install system dependencies (if needed)
RUN apt-get update -y && apt-get install -y --no-install-recommends build-essential \
git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set the working directory inside the container
WORKDIR /usr/app
# Copy your dbt project files into the container
COPY . .
# Install dbt and any required adapters (e.g., for Snowflake, BigQuery, etc.)
RUN pip install --upgrade pip
RUN pip install dbt-core dbt-snowflake -U
# Set the entrypoint to dbt
ENTRYPOINT ["dbt"]