Docker instructions

This commit is contained in:
Antonin Stefanutti 2015-11-15 20:21:19 +01:00
parent d4ea62751c
commit 26b1ee14c3

View File

@ -12,27 +12,10 @@ DeckTape can optionally be used to capture screenshots of your slide decks in va
You can browse some slide deck [examples](#examples) below that have been exported with DeckTape.
## The easy way to use
If you have Docker installed, you can easly use DeckTape. First launch your presentation (under `http://localhost:8000` for example). Then use the following command :
```sh
docker run --rm --net=host -v $(pwd):/output astefanutti/decktape http://localhost:8000 /output/slides.pdf
```
Your slides will be created under `slides.pdf` filename in the current directory.
You can also build the Docker images before running the container :
```sh
git clone https://github.com/astefanutti/decktape.git
cd decktape/
docker build -t astefanutti/decktape .
docker run --rm --net=host -v $(pwd):/output astefanutti/decktape http://localhost:8000 /output/slides.pdf
```
## Install
DeckTape provides a [Docker image](https://hub.docker.com/r/astefanutti/decktape/) so that its installation is made easier with [Docker](https://www.docker.com). If you have Docker installed, you can directly jump to the [Docker section](#docker). Else, you can follow the instructions below:
1. Shallow clone DeckTape Git repository:
git clone --depth 1 https://github.com/astefanutti/decktape.git
@ -64,6 +47,53 @@ docker run --rm --net=host -v $(pwd):/output astefanutti/decktape http://localho
If the executable isn't available for your target platform, see the [Build](#build) section and follow the instructions.
## Docker
DeckTape can be executed within a Docker container from the command-line:
```
docker run astefanutti/decktape -h
```
For example, to convert an online HTML presentation and have it exported into the working directory under the `slides.pdf` filename:
```
docker run --rm -v `pwd`:/pwd astefanutti/decktape http://lab.hakim.se/reveal-js/ /pwd/slides.pdf
```
Or, to convert an HTML presentation that's stored on the local file system in the `home` directory:
```
docker run --rm -v `pwd`:/pwd -v ~:/home astefanutti/decktape /home/slides.html /pwd/slides.pdf
```
Or, to convert an HTML presentation that's deployed on the local host:
```
docker run --rm --net=host -v `pwd`:/pwd astefanutti/decktape http://localhost:8000 /pwd/slides.pdf
```
It is recommended to use the following options from the [`docker run`](http://docs.docker.com/engine/reference/run/) command:
- [`--rm`](https://docs.docker.com/reference/run/#clean-up-rm): DeckTape is meant to be run as a short-term foreground process so that it's not necessary to have the containers file system persisted after DeckTape exits,
- [`-v`](http://docs.docker.com/engine/reference/commandline/run/#mount-volume-v-read-only): to mount a data volume so that DeckTape can directly write to the local file system.
Alternatively, you can use the [`docker cp`](http://docs.docker.com/engine/reference/commandline/cp/) command, e.g.:
```sh
# Run docker run without the --rm option
docker run astefanutti/decktape http://lab.hakim.se/reveal-js/ slides.pdf
# Copy the exported PDF from the latest used container to the local file system
docker cp `docker ps -lq`:decktape/slides.pdf .
# Finally remove the latest used container
docker rm `docker ps -lq`
```
Finally, if you want to execute DeckTape using a local clone of the DeckTape repository in order to take your changes into account, you can run:
```
docker run --rm -v `pwd`:`pwd` -w `pwd` astefanutti/decktape slides.html slides.pdf
```
## Usage
Into DeckTape install directory: