Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
alioguzhan committed Sep 25, 2019
2 parents 9031360 + 9a28b67 commit f234925
Show file tree
Hide file tree
Showing 3,767 changed files with 174,775 additions and 114,097 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -6,5 +6,4 @@ _site/**
.sass-cache/**
CNAME
Gemfile.lock
_samples/library/**
_kbase/**
2 changes: 1 addition & 1 deletion .gitmodules
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
@@ -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
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).
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Expand Up @@ -7,7 +7,7 @@ help. If a reviewer realizes you have based your work on the wrong branch, we'll
let you know so that you can rebase it.

>**Note**: To contribute code to Docker projects, see the
[Contribution guidelines](opensource/).
[Contribution guidelines](/opensource/).

### Files not edited here

Expand All @@ -30,7 +30,7 @@ you give it a try!

### Overall doc improvements

Most commits will be made against the `master` branch. This include:
Most commits will be made against the `master` branch. This includes:

- Conceptual and task-based information not specific to new features
- Restructuring / rewriting
Expand Down 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.
120 changes: 61 additions & 59 deletions Dockerfile
Expand Up @@ -2,90 +2,92 @@
# 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}

# Get the built docs output from the previous build stage
# This ordering means all previous layers can come from cache unless an archive
# changes
# 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 .

COPY --from=builder ${TARGET} ${TARGET}

# 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;'
# Build the current docs from the checked out branch
FROM builderbase AS current
COPY . .
COPY --from=upstream-resources /usr/src/app/md_source/. ./

# Build the static HTML, now that everything is in place
RUN jekyll build -d ${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


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

# Add the current version of the docs
COPY --from=current ${TARGET} ${TARGET}
136 changes: 114 additions & 22 deletions Jenkinsfile
@@ -1,25 +1,117 @@
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 tag docs/docker.github.io:prod-${env.BUILD_NUMBER} docs/docker.github.io:latest
docker push docs/docker.github.io:prod-${env.BUILD_NUMBER}
docker push docs/docker.github.io:latest
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
"""
}
}
}
}
}
post {
unsuccessful {
sh """
curl -X POST -H 'Content-type: application/json' --data '{"text":"Error in docker.github.io:published build. Please contact the Customer Success Engineering team for help."}' $SLACK
"""
}
}
}

0 comments on commit f234925

Please sign in to comment.