From 97511b7272262dd69527a718829fcb98f6cfa5a6 Mon Sep 17 00:00:00 2001 From: Ievgenii Shepeliuk Date: Sun, 25 Feb 2018 09:27:08 +0200 Subject: [PATCH] Alpine Linux based image for Antora --- .gitignore | 1 + Dockerfile | 18 ++++++++++++++++++ README.adoc | 25 ++++++++++++++++++++++--- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b51ea0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:8-alpine + +RUN apk --no-cache add --virtual .build-deps g++ libressl-dev make python curl-dev \ + && env BUILD_ONLY=true yarn global add @antora/cli @antora/site-generator-default \ + && apk del .build-deps \ + && apk --no-cache add libcurl libressl2.5-libtls \ + && mv $(yarn cache dir)/npm-nodegit-[0-9]* /tmp/ \ + && rm -rf $(yarn cache dir)/* \ + && find /tmp/npm-nodegit-* -regex '.*/\(include\|src\|vendor\)$' -maxdepth 1 -exec rm -rf {} \; \ + && find /tmp/npm-nodegit-*/lifecycleScripts/*install.js -exec sed -i '1s/^/return;\n/' {} \; \ + && mv /tmp/npm-nodegit-* $(yarn cache dir)/ \ + && find $(yarn global dir)/node_modules/nodegit -regex '.*/\(include\|src\|vendor\)$' -maxdepth 1 -exec rm -rf {} \; \ + && rm -rf $(yarn global dir)/node_modules/nodegit/build/Release/.deps + +WORKDIR /antora + +ENTRYPOINT ["antora"] +CMD ["--help"] diff --git a/README.adoc b/README.adoc index e70a7da..ff608f7 100644 --- a/README.adoc +++ b/README.adoc @@ -14,16 +14,35 @@ Its site generator pipeline aggregates documents from versioned content reposito === Run Directly +Assuming you have repository containing `Antora` playbook cloned to some folder and `cd` into that folder. + +As an example https://gitlab.com/antora/demo/demo-site[demo-site] will be used. + + $ git clone https://gitlab.com/antora/demo/demo-site.git + $ cd demo-site + You can run this image directly using the `docker run` command: -#TODO# show `docker run` command + $ docker run -v `pwd`:/antora antora --stacktrace generate site.yml === Use as a Base Image You can use this image as a base for your own image. -Create a `Dockerfile` file and add the following line at the top: -#TODO# show the `FROM` command in a sample Dockerfile +. Create a `Dockerfile` file and add the following line at the top:: ++ +[source] +.Dockerfile.custom +---- +FROM antora + +RUN yarn global add asciidoctor-plantuml <1> +---- +<1> add custom `Asciidoctor.js` extension to base image + +. Then build ++ + $ docker build -t antora:custom -f Dockerile.custom . == Copyright and License -- GitLab