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
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ RUN apt-get update && \
chown node:node /build && chmod 0750 /build

# Install custom gitbook version
RUN npm i gitbook-cli -g

USER node

RUN git clone -b fix/filename-regex https://github.com/PauloASilva/gitbook.git ~/gitbook-custom && \
cd ~/gitbook-custom && npm i && \
gitbook alias ~/gitbook-custom latest


WORKDIR /build
USER root
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN apt-get install -y pandoc texlive-latex-base texlive-fonts-recommended texlive-extra-utils texlive-latex-extra
COPY entrypoint.sh .
# RUN git clone "https://github.com/simonhaenisch/md-to-pdf" && cd md-to-pdf && npm link

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build:
build: .
image: dockersecbuilder:latest
entrypoint: gitbook pdf ./ ./dist/owasp-docker-security.pdf --gitbook=latest
entrypoint: /build/entrypoint.sh
volumes:
- .:/build

13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
VAR=""

for f in *.md; do
[[ -f $f ]] || continue
VAR+="'${f}' "
cat "$f" >> './dist/combined-guide.md'
done

IFS=$'\n'
echo "Combining Files" $VAR
pandoc ./dist/combined-guide.md -o ./dist/owasp-docker-security.pdf
# cat './dist/combined-guide.md' | md-to-pdf > ./dist/owasp-docker-security.pdf