Skip to content

Commit 612cb81

Browse files
committed
Add information about Docker usage
1 parent a110222 commit 612cb81

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ the ``tools/php-cs-fixer`` directory:
3939
4040
For more details and other installation methods, see `installation instructions <./doc/installation.rst>`__.
4141

42+
Run with Docker
43+
~~~~~~~~~~~~~~~
44+
45+
PHP CS Fixer can be run in a Docker container.
46+
47+
You can use pre-built Docker images to run ``php-cs-fixer``.
48+
49+
.. code:: console
50+
docker run -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3} fix src
51+
52+
``$FIXER_VERSION`` used in example above is an identifier of a release you want to use, which is based on Fixer and PHP versions combined. There are different tags for each Fixer's SemVer level and PHP version with syntax ``<php-cs-fixer-version>-php<php-version>``. For example:
53+
54+
* ``3.47.0-php7.4``
55+
* ``3.47-php8.0``
56+
* ``3-php8.3``
57+
4258
Usage
4359
~~~~~
4460

0 commit comments

Comments
 (0)