From 6bf0e7ac3285feff924f4e676c106b5421550c4a Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Tue, 26 Dec 2017 20:52:51 -0800 Subject: [PATCH] Improve archival dockerfile (#5365) --- .dockerignore | 5 +++++ Dockerfile | 12 ++++++++++-- Gemfile | 6 ++++++ _config.yml | 2 +- hooks/post_push | 14 -------------- 5 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 Gemfile delete mode 100755 hooks/post_push diff --git a/.dockerignore b/.dockerignore index a244c17ae6..877f711b6f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,7 @@ .git +.github +.jekyll-metadata +.gitignore +Dockerfile +docker-compose.yml _site diff --git a/Dockerfile b/Dockerfile index f1f697a9ee..4ce4a5eb33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ -FROM starefossen/github-pages:onbuild +# Set to the version for this archive +ARG VER=v1.5 -CMD jekyll serve -d /_site --watch -H 0.0.0.0 -P 4000 +# This image comes from the Dockerfile.builder.onbuild file in the publish-tools branch +# https://github.com/docker/docker.github.io/blob/publish-tools/Dockerfile.builder.onbuild +FROM docs/docker.github.io:docs-builder-onbuild AS builder + +# Reset the docs/docker.github.io:nginx-onbuild image, which is based on nginx:alpine +# This image comes from the Dockerfule.nginx.onbuild in the publish-tools branch +# https://github.com/docker/docker.github.io/blob/publish-tools/Dockerfile.nginx.onbuild +FROM docs/docker.github.io:nginx-onbuild diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..16aae934b1 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +# Update me once in a while: https://github.com/github/pages-gem/releases +# Please ensure, before upgrading, that this version exists as a tag in starefossen/github-pages here: +# https://hub.docker.com/r/starefossen/github-pages/tags/ +gem "github-pages", "147" \ No newline at end of file diff --git a/_config.yml b/_config.yml index 8e273b5b39..63d50196de 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -exclude: [src] +exclude: ["src","highlight","hooks"] diff --git a/hooks/post_push b/hooks/post_push deleted file mode 100755 index 815d2d60a4..0000000000 --- a/hooks/post_push +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -# If this is an archive branch (like v1.4 or v1.11), -# build and push the docs-base branch at the end of -# a successful build of the branch - -if [[ $SOURCE_BRANCH =~ (^v1\.[0-9]+$|^v1[7-9]\.[0-9]+$) ]]; then - git fetch origin docs-base:docs-base --depth 1 || ( echo "Couldn't fetch docs-base." && exit 1 ) - git checkout docs-base || ( echo "Couldn't check out docs-base." && exit 1 ) - docker build -t docs/docker.github.io:docs-base . || ( echo "Couldn't build docs-base Dockerfile." && exit 1 ) - docker push docs/docker.github.io:docs-base || ( echo "Coudn't push new docs-base image." && exit 1 ) -fi