Apache Airflow Provider(s)
docker
Versions of Apache Airflow Providers
apache-airflow-providers-docker[common-compat]>=4.4.1
apache-airflow-providers-http>=5.3.
apache-airflow-providers-postgres>=6.2.0
Apache Airflow version
3.0.2
Operating System
Manjaro
Deployment
Virtualenv installation
Deployment details
uv
[project]
name = "myproject"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "~=3.11"
dependencies = [
"apache-airflow>=3.0.2",
"apache-airflow-providers-docker[common-compat]>=4.4.1",
"apache-airflow-providers-http>=5.3.1",
"apache-airflow-providers-postgres>=6.2.0",
"httpx>=0.28.1",
"polars>=1.31.0",
"ruff>=0.12.2",
]
Running
AIRFLOW_HOME=$(CURDIR) \
AIRFLOW__CORE__LOAD_EXAMPLES=False \
AIRFLOW__CORE__EXECUTE_TASKS_NEW_PYTHON_INTERPRETER=True \
uv run airflow standalone
What happened
I'm trying to use the docker task.
It seems that the container is started, and the code is executed correctly.
Logs:
Log message source details: sources=["/logs/dag_id=docker_xcom_pipeline/run_id=manual__2025-07-09T08:35:46.168850+00:00/task_id=process_in_docker/attempt=1.log"]
[2025-07-09, 10:35:48] INFO - DAG bundles loaded: dags-folder: source="airflow.dag_processing.bundles.manager.DagBundlesManager"
[2025-07-09, 10:35:48] INFO - Filling up the DagBag from/dags/docker_xcom_pipeline.py: source="airflow.models.dagbag.DagBag"
[2025-07-09, 10:35:48] INFO - Starting docker container from image apache/airflow:3.0.2-python3.11: source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator"
[2025-07-09, 10:35:53] INFO - : source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator"
[2025-07-09, 10:35:53] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_SCRIPT"]);f = open("/tmp/script.py", "wb"); f.write(x);': source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator"
[2025-07-09, 10:35:53] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_INPUT"]);f = open("/tmp/script.in", "wb"); f.write(x);': source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator"
[2025-07-09, 10:35:53] INFO - + python3 /tmp/script.py /tmp/script.in /tmp/script.out none /tmp/script.out: source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator"
[2025-07-09, 10:35:56] ERROR - Task failed with exception: source="task"
AttributeError: '_DockerDecoratedOperator' object has no attribute 'xcom_push'
File "/.venv/lib/python3.11/site-packages/airflow/sdk/execution_time/task_runner.py", line 867 in run
File /.venv/lib/python3.11/site-packages/airflow/sdk/execution_time/task_runner.py", line 1159 in _execute_task
File "/.venv/lib/python3.11/site-packages/airflow/sdk/bases/operator.py", line 397 in wrapper
File "/.venv/lib/python3.11/site-packages/airflow/providers/docker/decorators/docker.py", line 194 in execute
File "/.venv/lib/python3.11/site-packages/airflow/sdk/bases/operator.py", line 397 in wrapper
File "/.venv/lib/python3.11/site-packages/airflow/sdk/bases/decorator.py", line 253 in execute
What you think should happen instead
No response
How to reproduce
Create a task with
@task.docker(
image="apache/airflow:3.0.2-python3.11",
multiple_outputs=True,
auto_remove="force",
network_mode="bridge",
)
def process_in_docker(input_data: dict) -> dict:
value = input_data.get("value", 0)
message = input_data.get("message", "")
return {
"double_value": value * 2,
"message": f"{message} (processed in Docker)"
}
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow Provider(s)
docker
Versions of Apache Airflow Providers
apache-airflow-providers-docker[common-compat]>=4.4.1
apache-airflow-providers-http>=5.3.
apache-airflow-providers-postgres>=6.2.0
Apache Airflow version
3.0.2
Operating System
Manjaro
Deployment
Virtualenv installation
Deployment details
uv
Running
What happened
I'm trying to use the docker task.
It seems that the container is started, and the code is executed correctly.
Logs:
What you think should happen instead
No response
How to reproduce
Create a task with
Anything else
No response
Are you willing to submit PR?
Code of Conduct