diff --git a/.dockerignore b/.dockerignore index f066a47962..5083b67c19 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,11 +1,18 @@ .dockerignore +.DS_Store .git +.github .gitignore +.gitmodules +.idea +.jekyll-metadata +.sass-cache tests _site CONTRIBUTING.md Dockerfile Dockerfile.archive docker-compose.yml +Gemfile Gemfile.lock Jenkinsfile diff --git a/Dockerfile b/Dockerfile index 71001c918f..6674f6b355 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,7 @@ ARG ENABLE_ARCHIVES=true ### # Set up base stages for building and deploying ### - -# Get basic configs and Jekyll env -FROM docs/docker.github.io:docs-builder AS builderbase +FROM starefossen/github-pages:198 AS builderbase ENV TARGET=/usr/share/nginx/html WORKDIR /usr/src/app/md_source/ @@ -58,8 +56,12 @@ FROM archives-${ENABLE_ARCHIVES} AS archives # Only add the files that are needed to build these reference docs, so that these # docs are only rebuilt if changes were made to ENGINE_BRANCH or DISTRIBUTION_BRANCH. # Disable caching (docker build --no-cache) to force updating these docs. -FROM builderbase AS upstream-resources +FROM alpine AS upstream-resources +RUN apk add --no-cache subversion wget +WORKDIR /usr/src/app/md_source/ COPY ./_scripts/fetch-upstream-resources.sh ./_scripts/ +ARG ENGINE_BRANCH +ARG DISTRIBUTION_BRANCH RUN ./_scripts/fetch-upstream-resources.sh . @@ -71,8 +73,8 @@ COPY --from=upstream-resources /usr/src/app/md_source/. ./ # substitute the "{site.latest_engine_api_version}" in the title for the latest # API docs, based on the latest_engine_api_version parameter in _config.yml RUN ./_scripts/update-api-toc.sh -RUN jekyll build -d ${TARGET} -RUN find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done +RUN jekyll build -d ${TARGET} \ + && find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done # This stage only contains the generated files. It can be used to host the diff --git a/Gemfile b/Gemfile index f6e2dd018e..f5ffef68d3 100644 --- a/Gemfile +++ b/Gemfile @@ -39,5 +39,5 @@ source "https://rubygems.org" # live site deploy, which uses the Dockerfiles found in the publish-tools # branch. -gem "github-pages", "177" +gem "github-pages", "198" gem 'wdm' if Gem.win_platform? diff --git a/_scripts/fetch-upstream-resources.sh b/_scripts/fetch-upstream-resources.sh index 924f1cbec2..66a804571e 100755 --- a/_scripts/fetch-upstream-resources.sh +++ b/_scripts/fetch-upstream-resources.sh @@ -24,7 +24,7 @@ svn co "https://github.com/docker/distribution/${distribution_svn_branch}/docs/s svn co "https://github.com/mirantis/compliance/trunk/docs/compliance" ./compliance || (echo "Failed docker/compliance download" && exit 1) # Cleanup svn directories -find . -name .svn -exec rm -rf '{}' \; +find . -name ".svn" -print0 | xargs -0 /bin/rm -rf # Get the Engine APIs that are in Swagger # Add a new engine/api/.md file to add a new API version page.