Commit 6e4581c7 authored by nimrod's avatar nimrod
Browse files

Updates.

- Use newer runas script, using gosu instead of sudo.
- Added test steps to the build using the example presentation (in fact
using Docker Hub as a sort of CI).
- Use newer Golang image.
- Small corrections to README.
- More streamlined Makefile.
- Added groff to image.
- Added XeTex to image.
parent 44234ad7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
*
!example/
example/.gitignore
+12 −5
Original line number Diff line number Diff line
FROM golang:1.9-alpine as on-change
FROM golang:1.11-alpine3.8 as on-change
RUN apk --update add git && \
    rm -rf /var/cache/apk/* && \
    /usr/local/go/bin/go get github.com/spelufo/on-change

FROM debian:stretch-slim
COPY --from=on-change /go/bin/on-change /usr/local/bin
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        fonts-font-awesome \
        gosu \
        graphviz \
        groff \
        lmodern \
        make \
        pandoc \
        sudo \
        texlive-extra-utils \
        texlive-fonts-extra \
        texlive-fonts-recommended \
@@ -19,11 +21,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
        texlive-latex-base \
        texlive-latex-extra \
        texlive-luatex \
        texlive-publishers && \
        texlive-publishers \
        texlive-xetex \
    && \
    rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/*
ADD [ "https://www.shore.co.il/blog/static/runas", "/entrypoint" ]
ENTRYPOINT [ "/bin/sh", "/entrypoint" ]
CMD [ "on-change", ".", "make" ]
VOLUME /volume
WORKDIR /volume
ENV HOME /volume
CMD [ "on-change", ".", "make" ]
# Run a test build.
COPY example/ /example/
RUN make -C /example all clean
+4 −2
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@ Markdown or DOT).

## Usage

`docker run -itv "$PWD:/project" adarnimrod/presentation`
`docker run --rm -itv "$PWD:/volume" adarnimrod/presentation`

Will watch the current directory and run `make` whenever a file changes. One can
add a shell alias `alias presentation='docker run -itv "$PWD:/volume"
add a shell alias `alias presentation='docker run --rm -itv "$PWD:/volume"
adarnimrod/presentation'` for easier use.

See the example folder for more details.
@@ -20,7 +20,9 @@ See the example folder for more details.
- [GNU Make](https://www.gnu.org/software/make/)
- [LuaTex](http://luatex.org/)
- [LaTeX](http://www.latex-project.org/)
- [XeTex](http://xetex.sourceforge.net/)
- [on-change](https://github.com/spelufo/on-change)
- [groff](https://www.gnu.org/software/groff/)

## License

+5 −3
Original line number Diff line number Diff line
@@ -3,10 +3,12 @@
all: presentation.pdf

presentation.pdf: diagram.pdf
	pandoc -t beamer presentation.md -o presentation.pdf

diagram.pdf: diagram.dot
	dot diagram.dot -Tpdf > diagram.pdf
%.pdf: %.md
	pandoc -t beamer $< -o $@

%.pdf: %.dot
	dot $< -Tpdf > $@

clean:
	- rm *.pdf