Skip to content

Commit

Permalink
Merge branch 'master' into npipe-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-plata authored Jul 22, 2019
2 parents ae1a46f + a05dbb8 commit 3f3c585
Show file tree
Hide file tree
Showing 3,613 changed files with 203,680 additions and 112,776 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
branch = f28e87c7b9dae139855b574e96f22822986249a8
[submodule "tests/src/golang.org/x/net"]
path = tests/src/golang.org/x/net
url = https://go.googlesource.com/net
url = https://github.com/golang/net
branch = 45e771701b814666a7eb299e6c7a57d0b1799e91
[submodule "tests/src/gopkg.in/yaml.v2"]
path = tests/src/gopkg.in/yaml.v2
Expand Down
Empty file added .nojekyll
Empty file.
15 changes: 15 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=https://docs.docker.com" />
<title>Docker Documentation</title>
</head>
<body>
<p>We have moved away from the <strong>docker.github.io</strong> domain. If you're not automatically redirected, please visit us at <a href="https://docs.docker.com">docs.docker.com</a>.</p>

<script>
window.location.assign("https://docs.docker.com" + window.location.pathname);
</script>
</body>
</html>
10 changes: 2 additions & 8 deletions 404.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,5 @@ notoc: true
tree: false
---

It seems the page you're looking for doesn't exist. Maybe you're on the wrong
track, maybe you found a broken link. Who knows?

Either way, here's a couple of options for you:

* [Open an issue](https://github.com/docker/docker.github.io/issues/new?title=I%20found%20a%20broken%20link&body=%3CDescribe%20how%20you%20got%20there%3E)
* [Go to back](/)
* [Tweet us something](https://twitter.com/docker)
![https://docs.docker.com/](/images/404-docs.png)
Please file an issue at [https://github.com/docker/docker.github.io](https://github.com/docker/docker.github.io/issues/new).
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,5 @@ know.

## Style guide

If you have questions about how to write for Docker's documentation, have a look
at the [style guide](/opensource/doc-style/). The style
guide provides guidance about grammar, syntax, formatting, styling, language, or
tone. If something isn't clear in the guide, submit an issue to let us
know or submit a pull request to help us improve it.
Docker does not currently maintain a style guide. Use your best judgment, and
try to follow the example set by the existing documentation.
130 changes: 71 additions & 59 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,90 +2,102 @@
# from the master branch of https://github.com/docker/docker.github.io
#
# Here is the sequence:
# 1. Set up the build
# 2. Fetch upstream resources
# 3. Build static HTML from master
# 4. Reset to clean tiny nginx image
# 5. Copy Nginx config and archive HTML, which don't change often and can be cached
# 6. Copy static HTML from previous build stage (step 3)
# 1. Set up base stages for building and deploying
# 2. Collect and build the archived documentation
# 3. Collect and build the reference documentation (from upstream resources)
# 4. Build static HTML from the current branch
# 5. Build the final image, combining the archives, reference docs, and
# current version of the documentation
#
# When the image is run, it starts Nginx and serves the docs at port 4000

# Get basic configs and Jekyll env
FROM docs/docker.github.io:docs-builder AS builder

# Set the target again
ENV TARGET=/usr/share/nginx/html

# Set the source directory to md_source
ENV SOURCE=md_source

# Get the current docs from the checked out branch
# ${SOURCE} will contain a directory for each archive
COPY . ${SOURCE}

####### START UPSTREAM RESOURCES ########
# Set vars used by fetch-upstream-resources.sh script
## Branch to pull from, per ref doc
## To get master from svn the svn branch needs to be 'trunk'. To get a branch from svn it needs to be 'branches/branchname'

# Engine
ENV ENGINE_SVN_BRANCH="branches/17.09.x"
ENV ENGINE_BRANCH="17.09.x"
ARG ENGINE_BRANCH="19.03.x"

# Distribution
ENV DISTRIBUTION_SVN_BRANCH="branches/release/2.6"
ENV DISTRIBUTION_BRANCH="release/2.6"
ARG DISTRIBUTION_BRANCH="release/2.7"

# Fetch upstream resources
RUN bash ./${SOURCE}/_scripts/fetch-upstream-resources.sh ${SOURCE}
####### END UPSTREAM RESOURCES ########

###
# Set up base stages for building and deploying
###

# Build the static HTML, now that everything is in place
# Get basic configs and Jekyll env
FROM docs/docker.github.io:docs-builder AS builderbase
ENV TARGET=/usr/share/nginx/html
WORKDIR /usr/src/app/md_source/

RUN jekyll build -s ${SOURCE} -d ${TARGET} --config ${SOURCE}/_config.yml
# Set vars used by fetch-upstream-resources.sh script
# Branch to pull from, per ref doc. To get master from svn the svn branch needs
# to be 'trunk'. To get a branch from svn it needs to be 'branches/branchname'
ARG ENGINE_BRANCH
ENV ENGINE_BRANCH=${ENGINE_BRANCH}
ENV ENGINE_SVN_BRANCH=branches/${ENGINE_BRANCH}

# Fix up some links, don't touch the archives
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
ARG DISTRIBUTION_BRANCH
ENV DISTRIBUTION_BRANCH=${DISTRIBUTION_BRANCH}
ENV DISTRIBUTION_SVN_BRANCH=branches/${DISTRIBUTION_BRANCH}

# BUILD OF MASTER DOCS IS NOW DONE!

# Reset to alpine so we don't get any docs source or extra apps
FROM nginx:alpine

# Set the target again
FROM nginx:alpine AS deploybase
ENV TARGET=/usr/share/nginx/html

# Get the nginx config from the nginx-onbuild image
# This hardly ever changes so should usually be cached
COPY --from=docs/docker.github.io:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# Get all the archive static HTML and put it into place
# Go oldest-to-newest to take advantage of the fact that we change older
# archives less often than new ones.
# To add a new archive, add it here
# AND ALSO edit _data/docsarchives/archives.yaml to add it to the drop-down
COPY --from=docs/docker.github.io:v1.4 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.5 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.6 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.7 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.8 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.9 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.10 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.11 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.12 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v1.13 ${TARGET} ${TARGET}
# Set the default command to serve the static HTML site
CMD echo -e "Docker docs are viewable at:\nhttp://0.0.0.0:4000"; exec nginx -g 'daemon off;'


# Build the archived docs
# these docs barely change, so can be cached
FROM deploybase AS archives
# Get all the archive static HTML and put it into place. To add a new archive,
# add it here, and ALSO edit _data/docsarchives/archives.yaml to add it to the drop-down
COPY --from=docs/docker.github.io:v17.03 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v17.06 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v17.09 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v17.12 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v18.03 ${TARGET} ${TARGET}
COPY --from=docs/docker.github.io:v18.09 ${TARGET} ${TARGET}

# Fetch library samples (documentation from official images on Docker Hub)
# Only add the files that are needed to build these reference docs, so that
# these docs are only rebuilt if changes were made to the configuration.
# @todo find a way to build HTML in this stage, and still have them included in the navigation tree
FROM builderbase AS library-samples
COPY ./_scripts/fetch-library-samples.sh ./_scripts/
COPY ./_samples/boilerplate.txt ./_samples/
RUN bash ./_scripts/fetch-library-samples.sh

# Fetch upstream resources (reference documentation)
# Only add the files that are needed to build these reference docs, so that
# these docs are only rebuilt if changes were made to the configuration.
FROM builderbase AS upstream-resources
COPY ./_scripts/fetch-upstream-resources.sh ./_scripts/
COPY ./_config.yml .
COPY ./_data/toc.yaml ./_data/
RUN bash ./_scripts/fetch-upstream-resources.sh .


# Build the current docs from the checked out branch
FROM builderbase AS current
COPY . .
COPY --from=library-samples /usr/src/app/md_source/. ./
COPY --from=upstream-resources /usr/src/app/md_source/. ./

# Get the built docs output from the previous build stage
# This ordering means all previous layers can come from cache unless an archive
# changes
# Build the static HTML, now that everything is in place
RUN jekyll build -d ${TARGET}

COPY --from=builder ${TARGET} ${TARGET}
# Fix up some links, don't touch the archives
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

# Serve the site (target), which is now all static HTML
CMD echo -e "Docker docs are viewable at:\nhttp://0.0.0.0:4000"; exec nginx -g 'daemon off;'

# Docs with archives (for deploy)
FROM archives AS deploy

# Add the current version of the docs
COPY --from=current ${TARGET} ${TARGET}
127 changes: 105 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,108 @@
wrappedNode(label: 'ubuntu-1604 && x86_64') {
timeout(time: 60, unit: 'MINUTES') {
deleteDir()
stage "checkout"
checkout scm
sh "git submodule update --init --recursive"
stage "test"
def reg = [credentialsId: 'csebuildbot', url: 'https://index.docker.io/v1/']

/* Jekyll creates html files to implement client side redirects.
There are absolute links to docs.docker.com in these htmls
we don't want them to be parsed by the tests for now.
Removing jekyll-redirect-from option will make sure these pages
are not generated when building with Jekyll. */
sh "awk '/jekyll-redirect-from/{n=1}; n {n--; next}; 1' < _config.yml > _config.yml.tmp"
sh "mv _config.yml.tmp _config.yml"

sh "docker build -t docs:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`"
sh "docker build -t tests:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`/tests"
sh "docker run -v /usr/src/app/allvbuild --name docs-${JOB_BASE_NAME}-${BUILD_NUMBER} docs:${JOB_BASE_NAME}-${BUILD_NUMBER} /bin/true"
sh "docker run --rm --volumes-from docs-${JOB_BASE_NAME}-${BUILD_NUMBER} -v `pwd`:/docs tests:${JOB_BASE_NAME}-${BUILD_NUMBER}"
sh "docker rm -fv docs-${JOB_BASE_NAME}-${BUILD_NUMBER}"
sh "docker rmi docs:${JOB_BASE_NAME}-${BUILD_NUMBER} tests:${JOB_BASE_NAME}-${BUILD_NUMBER}"
deleteDir()
pipeline {
agent {
label 'ubuntu-1604-aufs-stable'
}
environment {
DTR_URL = credentials('dtr-url')
DOCKER_HOST_STRING = credentials('docker-host')
UCP_BUNDLE = credentials('ucp-bundle')
SUCCESS_BOT_TOKEN = credentials('success-bot-token')
SLACK = credentials('slack-docs-webhook')
}
options {
timeout(time: 1, unit: 'HOURS')
}
stages {
stage( 'docker.github.io' ) {
when {
expression { env.GIT_URL == 'https://github.com/Docker/docker.github.io.git' }
}
stages {
stage( 'build + push stage image, update stage swarm' ) {
when {
branch 'master'
}
steps {
sh """
cat $SUCCESS_BOT_TOKEN | docker login $DTR_URL --username 'success_bot' --password-stdin
docker build -t $DTR_URL/docker/docker.github.io:stage-${env.BUILD_NUMBER} .
docker push $DTR_URL/docker/docker.github.io:stage-${env.BUILD_NUMBER}
unzip -o $UCP_BUNDLE
export DOCKER_TLS_VERIFY=1
export COMPOSE_TLS_VERSION=TLSv1_2
export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot
export DOCKER_HOST=$DOCKER_HOST_STRING
docker service update --detach=false --force --image $DTR_URL/docker/docker.github.io:stage-${env.BUILD_NUMBER} docs-stage-docker-com_docs --with-registry-auth
"""
}
}
stage( 'build + push prod image, update prod swarm' ) {
when {
branch 'published'
}
steps {
withDockerRegistry(reg) {
sh """
docker build -t docs/docker.github.io:prod-${env.BUILD_NUMBER} .
docker push docs/docker.github.io:prod-${env.BUILD_NUMBER}
unzip -o $UCP_BUNDLE
cd ucp-bundle-success_bot
export DOCKER_TLS_VERIFY=1
export COMPOSE_TLS_VERSION=TLSv1_2
export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot
export DOCKER_HOST=$DOCKER_HOST_STRING
docker service update --detach=false --force --image docs/docker.github.io:prod-${env.BUILD_NUMBER} docs-docker-com_docs --with-registry-auth
curl -X POST -H 'Content-type: application/json' --data '{"text":"Successfully published docs. https://docs.docker.com/"}' $SLACK
"""
}
}
}
}
}
stage( 'docs-private' ) {
when {
expression { env.GIT_URL == "https://github.com/docker/docs-private.git" }
}
stages {
stage( 'build + push beta-stage image, update beta-stage swarm' ) {
when {
branch 'amberjack'
}
steps {
sh """
cat $SUCCESS_BOT_TOKEN | docker login $DTR_URL --username 'success_bot' --password-stdin
docker build -t $DTR_URL/docker/docs-private:beta-stage-${env.BUILD_NUMBER} .
docker push $DTR_URL/docker/docs-private:beta-stage-${env.BUILD_NUMBER}
unzip -o $UCP_BUNDLE
export DOCKER_TLS_VERIFY=1
export COMPOSE_TLS_VERSION=TLSv1_2
export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot
export DOCKER_HOST=$DOCKER_HOST_STRING
docker service update --detach=false --force --image $DTR_URL/docker/docs-private:beta-stage-${env.BUILD_NUMBER} docs-beta-stage-docker-com_docs --with-registry-auth
"""
}
}
stage( 'build + push beta image, update beta swarm' ) {
when {
branch 'published'
}
steps {
sh """
cat $SUCCESS_BOT_TOKEN | docker login $DTR_URL --username 'success_bot' --password-stdin
docker build -t $DTR_URL/docker/docs-private:beta-${env.BUILD_NUMBER} .
docker push $DTR_URL/docker/docs-private:beta-${env.BUILD_NUMBER}
unzip -o $UCP_BUNDLE
export DOCKER_TLS_VERIFY=1
export COMPOSE_TLS_VERSION=TLSv1_2
export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot
export DOCKER_HOST=$DOCKER_HOST_STRING
docker service update --detach=false --force --image $DTR_URL/docker/docs-private:beta-${env.BUILD_NUMBER} docs-beta-docker-com_docs --with-registry-auth
"""
}
}
}
}
}
}
Loading

0 comments on commit 3f3c585

Please sign in to comment.