Skip to content

Commit

Permalink
Readme - add link to Docker Hub, split Usage chapter to build & usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubboucek committed Jun 24, 2019
1 parent 12fdab6 commit 32e9528
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,30 @@ Template container for wkhtmltopdf in HTTP server with PHP 7.3.
- ready to run in serverless environment ([Google Cloud Run](https://cloud.google.com/run/), etc.)

## Instalation
1. Clone Git repo
2. In project directory call `docker build -t wkpdf .`
3. Use it
1. Clone Git repo.
2. In project directory call `docker build -t redbitcz/wkpdf .`
3. Use it.
4. Profit!

## Template philosophy
This project does not provide finished solution, but only prepared container with
configured features – feel free to write your own app inside now.

## Build example
1. Download & install [Docker for you PC](https://www.docker.com/products/docker-desktop). Run it.
2. Open command line and try to call `docker -v` command – that must print version of installed Docker Desktop service.
3. Run `docker build -t redbitcz/wkpdf .` *(don't miss the dot at end)*. Docker now start build new Docker image from current
directory (especially from [Dockerfile](Dockerfile)) and tag it with name `redbitcz/wkpdf`.

You can also just pull from image [`redbitcz/wkpdf`](https://hub.docker.com/r/redbitcz/wkpdf).

## Usage example
1. Download & install [Docker for you PC](https://www.docker.com/products/docker-desktop).
2. Open command line and try to call `docker -v` command – that print version of installed Docker Desktop service.
3. Run `docker build -t wkpdf .` *(don't miss the dot at end)*. Docker now start build new Docker image from current
directory (especially from [Dockerfile](Dockerfile)) and tag it with name `wkpdf`.
4. Run ``docker run -v `pwd`:/out wkpdf wkhtmltopdf https://docs.docker.com/engine/reference/commandline/run/ /out/example.pdf``,
1. Run ``docker run -v `pwd`:/out redbitcz/wkpdf wkhtmltopdf https://docs.docker.com/engine/reference/commandline/run/ /out/example.pdf``,
Docker create container from your image and here call `wkhtmltopdf` which create new PDF file `example.pdf` from docker's website.
Contrainer is removed when `wkhtmltopdf` process ended.
5. Open and see new PDF `example.pdf` created in project diretory.
2. Open and see new PDF `example.pdf` created in current directory.

##

### Thanks to
- @boromino for great [inspiration how to delete more temporary file from container](https://github.com/boromino/php-wkhtmltopdf/blob/master/Dockerfile),
Expand Down

0 comments on commit 32e9528

Please sign in to comment.