diff options
-rw-r--r-- | .dockerignore | 4 | ||||
-rw-r--r-- | Dockerfile | 20 | ||||
-rw-r--r-- | _config.yml | 9 | ||||
-rw-r--r-- | bin/docker-helper.inc | 11 | ||||
-rwxr-xr-x | bin/docker-setup.sh | 2 | ||||
-rw-r--r-- | docker/Dockerfile | 8 |
6 files changed, 38 insertions, 16 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..15d0ebf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# Exclude everything except specified files. +* +!Gemfile +!Gemfile.lock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a9a89f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +ARG JEKYLL_VERSION=4.1.0 +FROM jekyll/jekyll:${JEKYLL_VERSION} +# py3-pygments: Needed for rbst Gem, because it calls Python directly +# py3-docutils: Needed for GLEPs +# GnuPG: Needed for WKD +RUN apk add --no-cache \ + gnupg \ + python3 \ + py3-docutils \ + py3-pygments \ + && ln -sf python3 /usr/bin/python + +# Ruby stuff +COPY Gemfile /srv/jekyll/ +COPY Gemfile.lock /srv/jekyll/ +ARG BUNDLE_JOBS=2 +RUN cd /srv/jekyll/ \ + && bundle install \ + && rm -vrf \ + /home/jekyll/.bundle/cache diff --git a/_config.yml b/_config.yml index 695e580..fd760db 100644 --- a/_config.yml +++ b/_config.yml @@ -41,11 +41,14 @@ defaults: values: layout: passthrough +plugins: ['nokogiri'] +# Exclude everything and only include specific items exclude: - bin +- Dockerfile* +- .dockerignore +- Gemfile* +- Makefile - README.md - TODO - wget-log* -- docker/ -- Gemfile* -plugins: ['nokogiri'] diff --git a/bin/docker-helper.inc b/bin/docker-helper.inc index d084d2e..a1bc41f 100644 --- a/bin/docker-helper.inc +++ b/bin/docker-helper.inc @@ -5,7 +5,7 @@ TRACE=${TRACE:=0} IMAGE_NAME=docker.gentoo.org/sites/www IMAGE_TAG=latest IMAGE=${IMAGE_NAME}:${IMAGE_TAG} -IMAGE_SRC=docker/ +IMAGE_SRC=./ docker_build() { # Always refresh the image @@ -17,10 +17,15 @@ docker_build() { } _docker_run_common() { + _UID=$(id -u) + _GID=$(id -g) docker run \ --rm \ - -e JEKYLL_UID="$(id -u)" \ - -e JEKYLL_GID="$(id -g)" \ + -e JEKYLL_UID="${_UID}" \ + -e JEKYLL_GID="${_GID}" \ + -e JEKYLL_ROOTLESS= \ + -e CONNECTED=false \ + -e DEBUG=false \ --volume="${PWD}:/srv/jekyll" \ "$@" } diff --git a/bin/docker-setup.sh b/bin/docker-setup.sh index 217425d..7722a53 100755 --- a/bin/docker-setup.sh +++ b/bin/docker-setup.sh @@ -2,5 +2,3 @@ set -e source "$(dirname "$0")"/docker-helper.inc docker_build -docker_run_net_host bundle install - diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index e40b239..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG JEKYLL_VERSION=4.1.0 -FROM jekyll/jekyll:${JEKYLL_VERSION} -VOLUME /srv/jekyll -# Needed for rbst Gem, because it calls Python directly -RUN apk add python3 py3-docutils py3-pygments \ - && ln -sf python3 /usr/bin/python -# Needed for WKD -RUN apk add gnupg |