- First, build the Docker image from the Dockerfile you provided, if you haven’t already. Make sure your Dockerfile is located in your current working directory. In your terminal, run:
docker build -t my-airflow-image .
Replace my-airflow-image witha name you prefer for your Docker image.
- Once the image is built, you can run a Docker container from it. The following command will run the container and map the default Airflow webserver port (8080) to the host machine:
docker run -d --name my-airflow-container -p 8080:8080 my-airflow-image
Replace my-airflow-container with a name you prefer for your Docker container.
- To check if the container is running, use the following command:
You should see your container listed with the name you provided.
- Now, the Airflow webserver should be running on port 8080 of your host machine. Open a web browser and navigate to:
You should see the Airflow UI.
Please note that this guide assumes you have a functional Airflow installation within the Docker image. If you encounter any issues, you might need to review your Dockerfile and make sure all the necessary configurations and dependencies for Airflow are set up properly.