Sachin Bedraman
12/24/2025, 7:13 AMkapa.ai
12/24/2025, 7:14 AMbuild_customization.py file to your connector folder. This file uses a pre/post build hook framework to mutate the container: python from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from dagger import Container async def pre_connector_install(base_image_container: Container) -> Container: return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "value") async def post_connector_install(connector_container: Container) -> Container: return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "value") [[Migration Guide](https://docs.airbyte.com/platform/connector-development/cdk-python/migration-to-base-image)] ### 2. During Acceptance Testing When running Connector Acceptance Tests (CAT), you can specify custom environment variables in the test configuration file: yaml connector_image: "airbyte/source-pokeapi" custom_environment_variables: my_custom_environment_variable: value [[Acceptance Tests Reference](https://docs.airbyte.com/platform/connector-development/testing-connectors/connector-acceptance-tests-reference#custom-environment-variable)] ### 3. During Debugging (Docker Compose) If you are debugging a connector launched by the Airbyte worker, you can pass environment variables (specifically for Java options) through the worker container. By setting DEBUG_CONTAINER_IMAGE and DEBUG_CONTAINER_JAVA_OPTS in your docker-compose.debug.yaml, the worker will inject these into the target connector container when it spawns [[Debugging Docker](https://docs.airbyte.com/platform/connector-development/debugging-docker#debugging-containers-launched-by-the-worker-container)]. ### 4. Limitations for Production Operators Currently, there is no built-in "out of the box" solution for an operator to globally inject environment variables into all connector instances without including them in the Dockerfile or the connector spec (which makes them visible to users) [[Forum Post 1861](https://discuss.airbyte.io/t/1861); [Forum Post 986](https://discuss.airbyte.io/t/986)]. Suggested workarounds include: * Hardcoding constants into the connector's Dockerfile. * Passing variables through the API during source/destination creation if you want to avoid user-facing fields in the UI.