diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..191381ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..1d0335ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM kicadeda/kicad-doc-builder-base:latest as doc-build-env + +WORKDIR /src +COPY . . + +RUN mkdir -p build +WORKDIR /src/build +RUN cmake -DBUILD_FORMATS="pdf;epub" ../ +RUN make + +FROM scratch as output-image + +COPY --from=doc-build-env /src/build/src /src \ No newline at end of file diff --git a/utils/docker/Dockerfile b/utils/docker/Dockerfile deleted file mode 100644 index 4cc71743..00000000 --- a/utils/docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM ubuntu:bionic - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -RUN apt-get -y install git make cmake asciidoc pandoc gettext po4a dblatex texlive-xetex fonts-vlgothic source-highlight texlive-lang-english texlive-lang-french texlive-lang-italian texlive-lang-japanese texlive-lang-european texlive-lang-polish fonts-freefont-ttf texlive-lang-cyrillic texlive-lang-german texlive-lang-other texlive-lang-spanish texlive-lang-chinese - -WORKDIR /mnt/kicad-doc -CMD mkdir -p build && cd build && cmake .. && make diff --git a/utils/docker/Dockerfile.kicad-doc-builder-base b/utils/docker/Dockerfile.kicad-doc-builder-base new file mode 100644 index 00000000..3fd06217 --- /dev/null +++ b/utils/docker/Dockerfile.kicad-doc-builder-base @@ -0,0 +1,11 @@ +FROM debian:latest + +RUN apt update && apt install asciidoc cmake dblatex fonts-freefont-ttf \ + fonts-vlgothic gettext git make po4a source-highlight \ + texlive-lang-cyrillic texlive-lang-english texlive-lang-european \ + texlive-lang-french texlive-lang-german texlive-lang-italian \ + texlive-lang-japanese texlive-lang-other texlive-lang-polish \ + texlive-lang-spanish texlive-xetex texlive-lang-chinese \ + ruby-full rubygems -y + +CMD echo "Placeholder." \ No newline at end of file diff --git a/utils/docker/README.adoc b/utils/docker/README.adoc index a3141698..59412007 100644 --- a/utils/docker/README.adoc +++ b/utils/docker/README.adoc @@ -1,13 +1,4 @@ -This is a Docker image builder that produces an environment capable of building -the KiCad documentation. - -.Method -* Install Docker. On Ubuntu: `sudo apt-get install docker.io` -* Clone the docs -** `git clone https://github.com/ciampix/kicad-doc` -* Build the Docker image (you only need to do this once, or if you change the Dockerfile - or files that go into the image: -** `sudo docker build -t kicad-img kicad-doc/utils/docker` -* Run the build script within docker: -** `sudo docker run -v $(pwd)/kicad-doc:/mnt/kicad-doc kicad-img` +# Readme +## kicad-doc-builder-base +This creates a base container image with the tools required to build the docs repo without going through the process of installing over a gigabyte of tools each time. \ No newline at end of file diff --git a/utils/docker/make.docker.sh b/utils/docker/make.docker.sh deleted file mode 100755 index 15c825c1..00000000 --- a/utils/docker/make.docker.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash -# Script to build the KiCad docs within a Docker container -# - -# where the docs are pulled down to -adocRoot=/mnt/src/kicad-doc/src - -# function build each sub directory -function makeAll { - cd "$adocRoot/$1" - export TOC2='-a toc2' #Set side toc for HTML - ./make.sh all-all -} - -cd "$adocRoot" - -# build each sub directory -makeAll cvpcb -makeAll eeschema -makeAll gerbview -makeAll getting_started_in_kicad -makeAll idf_exporter -makeAll interactive_router -makeAll kicad -makeAll pcbnew -makeAll pl_editor