Skip to content

Commit

Permalink
[fix](doc)Fix Docker Compose up Airflow init command
Browse files Browse the repository at this point in the history
Fix Docker Compose up Airflow init command
  • Loading branch information
cjj2010 committed Apr 29, 2024
1 parent 28a240a commit d351df5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/apache-airflow/howto/docker-compose/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This file contains several service definitions:
- ``postgres`` - The database.
- ``redis`` - `The redis <https://redis.io/>`__ - broker that forwards messages from scheduler to worker.

Optionally, you can enable flower by adding ``--profile flower`` option, e.g. ``docker compose --profile flower up``, or by explicitly specifying it on the command line e.g. ``docker compose up flower``.
Optionally, you can enable flower by adding ``--profile flower`` option, e.g. ``docker-compose --profile flower up``, or by explicitly specifying it on the command line e.g. ``docker-compose up flower``.

- ``flower`` - `The flower app <https://flower.readthedocs.io/en/latest/>`__ for monitoring the environment. It is available at ``http://localhost:5555``.

Expand Down Expand Up @@ -149,7 +149,7 @@ On **all operating systems**, you need to run database migrations and create the

.. code-block:: bash
docker compose up airflow-init
docker-compose up airflow-init
After initialization is complete, you should see a message like this:

Expand All @@ -171,7 +171,7 @@ up and restart from scratch.

The best way to do this is to:

* Run ``docker compose down --volumes --remove-orphans`` command in the directory you downloaded the
* Run ``docker-compose down --volumes --remove-orphans`` command in the directory you downloaded the
``docker-compose.yaml`` file
* Remove the entire directory where you downloaded the ``docker-compose.yaml`` file
``rm -rf '<DIRECTORY>'``
Expand All @@ -184,7 +184,7 @@ Now you can start all services:

.. code-block:: bash
docker compose up
docker-compose up
.. note::
docker-compose is old syntax. Please check `Stackoverflow <https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose>`__.
Expand Down Expand Up @@ -218,7 +218,7 @@ You can also run :doc:`CLI commands <../usage-cli>`, but you have to do it in on

.. code-block:: bash
docker compose run airflow-worker airflow info
docker-compose run airflow-worker airflow info
If you have Linux or Mac OS, you can make your work easier and download a optional wrapper scripts that will allow you to run commands with a simpler command.

Expand Down Expand Up @@ -279,17 +279,17 @@ To stop and delete containers, delete volumes with database data and download im

.. code-block:: bash
docker compose down --volumes --rmi all
docker-compose down --volumes --rmi all
Using custom images
===================

When you want to run Airflow locally, you might want to use an extended image, containing some additional dependencies - for
example you might add new python packages, or upgrade airflow providers to a later version. This can be done very easily
by specifying ``build: .`` in your ``docker-compose.yaml`` and placing a custom Dockerfile alongside your
``docker-compose.yaml``. Then you can use ``docker compose build`` command
to build your image (you need to do it only once). You can also add the ``--build`` flag to your ``docker compose`` commands
to rebuild the images on-the-fly when you run other ``docker compose`` commands.
``docker-compose.yaml``. Then you can use ``docker-compose build`` command
to build your image (you need to do it only once). You can also add the ``--build`` flag to your ``docker-compose`` commands
to rebuild the images on-the-fly when you run other ``docker-compose`` commands.

Examples of how you can extend the image with custom providers, python packages,
apt packages and more can be found in :doc:`Building the image <docker-stack:build>`.
Expand Down Expand Up @@ -337,8 +337,8 @@ that conflicts with the version of apache-airflow that you are using.

3) Place ``requirements.txt`` file in the same directory.

Run ``docker compose build`` to build the image, or add ``--build`` flag to ``docker compose up`` or
``docker compose run`` commands to build the image automatically as needed.
Run ``docker-compose build`` to build the image, or add ``--build`` flag to ``docker-compose up`` or
``docker-compose run`` commands to build the image automatically as needed.

Special case - Adding a custom config file
==========================================
Expand Down

0 comments on commit d351df5

Please sign in to comment.