Skip to content

Commit 813162e

Browse files
committed
Update README about running as a container
1 parent fabb49d commit 813162e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,32 @@ Use [composer](https://getcomposer.org/), so please run
2121
composer require phpcfdi/cfditopdf
2222
```
2323

24+
## Run with Docker
25+
26+
Running as a Docker container lets you use this CLI anywhere where Docker is installed without worrying about about any dependencies, not even PHP itself.
27+
28+
```shell
29+
# This will mount the current working directory
30+
# into a the /data directory inside the container
31+
docker run --rm \
32+
--volume $PWD:/data \
33+
--user $(id -u):$(id -g) \
34+
ghcr.io/phpcfdi/cfditopdf:latest \
35+
/data/my-cfdi.xml \
36+
/data/my-cfdi-output.pdf
37+
```
38+
39+
You can optionally set an alias in your shell to simplify running the container (to make this alias permanent add the alias to your .bashrc fille).
40+
41+
```shell
42+
alias cfditopdf='docker run --rm --volume $PWD:/data --user $(id -u):$(id -g) ghcr.io/phpcfdi/cfditopdf:latest'
43+
44+
# Then, execute just as `cfditopdf` (see usage in the next section)
45+
46+
cfditopdf --help
47+
cfditopdf /data/my-cfdi.xml /data/my-cfdi-output.pdf
48+
```
49+
2450
## Basic usage from CLI
2551

2652
```text

0 commit comments

Comments
 (0)