diff --git a/docs/DRIVER_SPEC.md b/docs/DRIVER_SPEC.md index e4bcc79847..762eddbd9e 100644 --- a/docs/DRIVER_SPEC.md +++ b/docs/DRIVER_SPEC.md @@ -1,3 +1,14 @@ + + # Machine Driver Specification v1 This is the standard configuration and specification for version 1 drivers. diff --git a/docs/Dockerfile b/docs/Dockerfile index 182390d724..26d4e61151 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,15 +1,24 @@ -FROM docs/base:latest -MAINTAINER Sven Dowideit (@SvenDowideit) +FROM docs/base:hugo +MAINTAINER Mary Anthony (@moxiegirl) # to get the git info for this repo COPY . /src -# Reset the /docs dir so we can replace the theme meta with the new repo's git info -RUN git reset --hard +COPY . /docs/content/machine/ -RUN grep "VERSION =" /src/version/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION -COPY docs/* /docs/sources/machine/ -COPY docs/mkdocs.yml /docs/mkdocs-machine.yml - -# Then build everything together, ready for mkdocs -RUN /docs/build.sh +# Sed to process GitHub Markdown +# 1-2 Remove comment code from metadata block +# 3 Remove .md extension from link text +# 4 Change ](/ to ](/project/ in links +# 5 Change ](word) to ](/project/word) +# 6 Change ](../../ to ](/project/ +# 7 Change ](../ to ](/project/word) +# +# +RUN find /docs/content/machine -type f -name "*.md" -exec sed -i.old \ + -e '/^/g' \ + -e '/^/g' \ + -e 's/\([(]\)\(.*\)\(\.md\)/\1\2/g' \ + -e 's/\(\]\)\([(]\)\(\/\)/\1\2\/machine\//g' \ + -e 's/\(\][(]\)\([A-z]*[)]\)/\]\(\/machine\/\2/g' \ + -e 's/\(\][(]\)\(\.\.\/\)/\1\/machine\//g' {} \; \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000..021e8f6e5e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,55 @@ +.PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate + +# env vars passed through directly to Docker's build scripts +# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily +# `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these +DOCKER_ENVS := \ + -e BUILDFLAGS \ + -e DOCKER_CLIENTONLY \ + -e DOCKER_EXECDRIVER \ + -e DOCKER_GRAPHDRIVER \ + -e TESTDIRS \ + -e TESTFLAGS \ + -e TIMEOUT +# note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds + +# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs) +DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) + +# to allow `make DOCSPORT=9000 docs` +DOCSPORT := 8000 + +# Get the IP ADDRESS +DOCKER_IP=$(shell python -c "import urlparse ; print urlparse.urlparse('$(DOCKER_HOST)').hostname or ''") +HUGO_BASE_URL=$(shell test -z "$(DOCKER_IP)" && echo localhost || echo "$(DOCKER_IP)") +HUGO_BIND_IP=0.0.0.0 + +GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) +DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH)) +DOCKER_DOCS_IMAGE := docs-base$(if $(GIT_BRANCH),:$(GIT_BRANCH)) + + +DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE + +# for some docs workarounds (see below in "docs-build" target) +GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) + +default: docs + +docs: docs-build + $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP) + +docs-draft: docs-build + $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --buildDrafts="true" --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP) + + +docs-shell: docs-build + $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash + + +docs-build: +# ( git remote | grep -v upstream ) || git diff --name-status upstream/release..upstream/docs ./ > ./changed-files +# echo "$(GIT_BRANCH)" > GIT_BRANCH +# echo "$(AWS_S3_BUCKET)" > AWS_S3_BUCKET +# echo "$(GITCOMMIT)" > GITCOMMIT + docker build -t "$(DOCKER_DOCS_IMAGE)" . diff --git a/docs/install-machine.md b/docs/install-machine.md new file mode 100644 index 0000000000..c5a4544ac4 --- /dev/null +++ b/docs/install-machine.md @@ -0,0 +1,81 @@ + + +## Install Docker Machine + +Docker Machine is supported on Windows, OS X, and Linux and is installable as one +standalone binary. The links to the binaries for the various platforms and +architectures are below: + +- [Windows - 32bit](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_windows-386.exe) +- [Windows - 64bit](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_windows-amd64.exe) +- [OSX - x86_64](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64) +- [OSX - (old macs)](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-386) +- [Linux - x86_64](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64) +- [Linux - i386](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-386) + +### OSX and Linux + +To install on OSX or Linux, download the proper binary to somewhere in your +`PATH` (e.g. `/usr/local/bin`) and make it executable. For instance, to install on +most OSX machines these commands should suffice: + +``` +$ curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine +$ chmod +x /usr/local/bin/docker-machine +``` + +For Linux, just substitute "linux" for "darwin" in the binary name above. + +Now you should be able to check the version with `docker-machine -v`: + +``` +$ docker-machine -v +machine version 0.2.0 +``` + +In order to run Docker commands on your machines without having to use SSH, make +sure to install the Docker client as well, e.g.: + +``` +$ curl -L https://get.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local/bin/docker +``` + +### Windows + +Currently, Docker recommends that you install and use Docker Machine on Windows +with [msysgit](https://msysgit.github.io/). This will provide you with some +programs that Docker Machine relies on such as `ssh`, as well as a functioning +shell. + +When you have installed msysgit, start up the terminal prompt and run the +following commands. Here it is assumed that you are on a 64-bit Windows +installation. If you are on a 32-bit installation, please substitute "i386" for +"x86_64" in the URLs mentioned. + +First, install the Docker client binary: + +``` +$ curl -L https://get.docker.com/builds/Windows/x86_64/docker-latest.exe > /bin/docker +``` + +Next, install the Docker Machine binary: + +``` +$ curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_windows-amd64.exe > /bin/docker-machine +``` + +Now running `docker-machine` should work. + +``` +$ docker-machine -v +machine version 0.2.0 +``` \ No newline at end of file diff --git a/docs/index.md b/docs/machine-overview.md similarity index 99% rename from docs/index.md rename to docs/machine-overview.md index 63fb53401b..3601ceec90 100644 --- a/docs/index.md +++ b/docs/machine-overview.md @@ -1,8 +1,12 @@ ---- -page_title: Docker Machine -page_description: Working with Docker Machine -page_keywords: docker, machine, amazonec2, azure, digitalocean, google, openstack, rackspace, softlayer, virtualbox, vmwarefusion, vmwarevcloudair, vmwarevsphere, exoscale ---- + # Docker Machine @@ -1638,4 +1642,4 @@ select a `debian-8-x64` image on DigitalOcean you would supply the following: If you change the base image for a provider, you may also need to change the SSH user. For example, the default Red Hat AMI on EC2 expects the SSH user to be `ec2-user`, so you would have to specify this with -`--amazonec2-ssh-user ec2-user`. +`--amazonec2-ssh-user ec2-user`. \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml deleted file mode 100644 index df43565df1..0000000000 --- a/docs/mkdocs.yml +++ /dev/null @@ -1,2 +0,0 @@ - -- ['machine/index.md', 'User Guide', 'Docker Machine' ] diff --git a/experimental/b2d_migration.md b/experimental/b2d_migration.md index ad33b37884..0b290044b5 100644 --- a/experimental/b2d_migration.md +++ b/experimental/b2d_migration.md @@ -63,4 +63,4 @@ When migrating a Boot2Docker VM to Docker Machine the Boot2Docker VM is left int ** `ls` will show all machines including their status -*** the `url` command reports the entire Docker URL including the IP / Hostname +*** the `url` command reports the entire Docker URL including the IP / Hostname \ No newline at end of file diff --git a/experimental/b2d_migration_tasks.md b/experimental/b2d_migration_tasks.md index 818b9dad7f..d59e53141e 100644 --- a/experimental/b2d_migration_tasks.md +++ b/experimental/b2d_migration_tasks.md @@ -1,3 +1,14 @@ + + # Boot2Docker Migration This document is a rough guide to what will need to be completed to support migrating from boot2docker-cli to Machine. It is not meant to be a user guide