Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github
README.md
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:latest

USER root
RUN apt-get update && apt -y install \
ghostscript \
librsvg2-bin \
texlive-latex-recommended \
texlive-latex-extra \
pandoc

USER nobody
COPY --chown=nobody:nobody shrinkpdf.sh /usr/local/bin/shrinkpdf.sh
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ Download the script and make it executable:
chmod +x shrinkpdf.sh
```

or you run it within a Docker container
```sh
# check out the repo
git clone git@github.com:aklomp/shrinkpdf.git && cd shrinkpdf
# build it first
docker build -t shrinkpdf:local .
# run it by mounting the current directory
docker run -it -v $(pwd):/build -w /build shrinkpdf:local bash
# as the script is stored in /usr/local/bin
shrinkpdf.sh in.pdf > out.pdf
```

If you run it with no arguments, it prints a usage summary. If you run it with a
single argument -- the name of the pdf to shrink -- it writes the result to
`stdout`:
Expand Down