Installing Apache Airflow on Windows 11 with Docker, but container exiting

680 views Asked by At

I followed these steps to set up Airflow in Docker Desktop:

  • ran docker pull apache/airflow:latest on command prompt
  • created a folder to store Airflow configurations and DAGs, e.g., C:\airflow
  • executed docker run -d -p 8080:8080 -v %cd%:/opt/airflow apache/airflow:latest to start the Airflow Docker container

Looking at the logs for the container in Docker Desktop, it immediately exited with the message:

airflow command error: the following arguments are required: GROUP_OR_COMMAND

Does anybody know why the container doesn't start? How can the command error be fixed?

I also tried to install Apache Airflow without Docker using pip, initializing Airflow database, creating an admin user, but Airflow webserver doesn´t start.

1

There are 1 answers

1
Jered On BEST ANSWER

Based on the message, it seems like you need to add a command to start the airflow service in the container. I imagine it is running airflow without specifying a command. For example, to start the webserver, it would need to run airflow webserver. Checking the image in Dockerhub, that appears to be accurate.

However, even if you get the container up, it will still not work, because Airflow requires a back end database to communicate with & multiple other components. I recommend following this guide to set up a local environment for Airflow using Docker. This guide uses Docker compose, which will initialize all the components for a working Airflow installation (You can see how complex it can become by viewing their compose yaml).