X Tutup
Skip to content

Commit 1749d99

Browse files
author
Mary Anthony
committed
- Updating install docs fixes docker-archive-public#1648
- Updating the Dockerfile to lastest - Adding support for building all the public doc projects from machine Signed-off-by: Mary Anthony <mary@docker.com> Michael's comments Signed-off-by: Mary Anthony <mary@docker.com> Adding in comments from nathan Signed-off-by: Mary Anthony <mary@docker.com>
1 parent af08468 commit 1749d99

File tree

13 files changed

+185
-63
lines changed

13 files changed

+185
-63
lines changed

docs/Dockerfile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
FROM docs/base:latest
22
MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)
33

4-
# to get the git info for this repo
4+
# To get the git info for this repo
55
COPY . /src
66

77
COPY . /docs/content/machine/
88

9+
RUN svn checkout https://github.com/docker/compose/trunk/docs /docs/content/compose
10+
RUN svn checkout https://github.com/docker/docker/trunk/docs /docs/content/docker
11+
RUN svn checkout https://github.com/docker/swarm/trunk/docs /docs/content/swarm
12+
RUN svn checkout https://github.com/docker/distribution/trunk/docs /docs/content/registry
13+
RUN svn checkout https://github.com/docker/tutorials/trunk/docs /docs/content
14+
RUN svn checkout https://github.com/docker/opensource/trunk/docs /docs/content/opensource
15+
RUN svn checkout https://github.com/kitematic/kitematic/trunk/docs /docs/content/kitematic
16+
17+
918
# Sed to process GitHub Markdown
1019
# 1-2 Remove comment code from metadata block
1120
# 3 Change ](/word to ](/project/ in links
1221
# 4 Change ](word.md) to ](/project/word)
1322
# 5 Remove .md extension from link text
14-
# 6 Change ](./ to ](/project/word)
15-
# 7 Change ](../../ to ](/project/
16-
# 8 Change ](../ to ](/project/
23+
# 6 Change ](../ to ](/project/word)
24+
# 7 Change ](../../ to ](/project/ --> not implemented
25+
#
1726
#
18-
RUN find /docs/content/machine -type f -name "*.md" -exec sed -i.old \
19-
-e '/^<!.*metadata]>/g' \
20-
-e '/^<!.*end-metadata.*>/g' \
21-
-e 's/\(\]\)\([(]\)\(\/\)/\1\2\/machine\//g' \
22-
-e 's/\(\][(]\)\([A-z].*\)\(\.md\)/\1\/machine\/\2/g' \
23-
-e 's/\([(]\)\(.*\)\(\.md\)/\1\2/g' \
24-
-e 's/\(\][(]\)\(\.\/\)/\1\/machine\//g' \
25-
-e 's/\(\][(]\)\(\.\.\/\.\.\/\)/\1\/machine\//g' \
26-
-e 's/\(\][(]\)\(\.\.\/\)/\1\/machine\//g' {} \;
27+
RUN /src/pre-process.sh /docs

docs/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Contributing to the Docker Compose documentation
2+
3+
The documentation in this directory is part of the [this documentation](docs.docker.com). Docker uses [the Hugo static generator](http://gohugo.io/overview/introduction/) to convert project Markdown files to a static HTML site.
4+
5+
You don't need to be a Hugo expert to contribute to the compose documentation. If you are familiar with Markdown, you can modify the content in the `docs` files.
6+
7+
If you want to add a new file or change the location of the document in the menu, you do need to know a little more. If you want the detail of contributing, [use our contributor guide](http://docs.docker.com/project/make-a-contribution/).
8+
9+
## Documentation contributing workflow
10+
11+
1. Edit a Markdown file in the tree.
12+
13+
2. Save your changes.
14+
15+
3. Make sure all your changes maintain an 80 character line wrap.
16+
17+
All check lines you've written. Don't wrap content you didn't change material.
18+
19+
3. Make sure you are in the `docs` subdirectory.
20+
21+
4. Build the documentation.
22+
23+
$ make docs
24+
---> ffcf3f6c4e97
25+
Removing intermediate container a676414185e8
26+
Successfully built ffcf3f6c4e97
27+
docker run --rm -it -e AWS_S3_BUCKET -e NOCACHE -p 8000:8000 -e DOCKERHOST "docs-base:test-tooling" hugo server --port=8000 --baseUrl=192.168.59.103 --bind=0.0.0.0
28+
ERROR: 2015/06/13 MenuEntry's .Url is deprecated and will be removed in Hugo 0.15. Use .URL instead.
29+
0 of 4 drafts rendered
30+
0 future content
31+
12 pages created
32+
0 paginator pages created
33+
0 tags created
34+
0 categories created
35+
in 55 ms
36+
Serving pages from /docs/public
37+
Web Server is available at http://0.0.0.0:8000/
38+
Press Ctrl+C to stop
39+
40+
5. Open the available server in your browser.
41+
42+
The documentation server has the complete menu but only the Docker Compose
43+
documentation resolves. You can't access the other project docs from this
44+
localized build.
45+
46+
## Tips on Hugo metadata and menu positioning
47+
48+
The top of each Docker Compose documentation file contains TOML metadata. The metadata is commented out to prevent it from appearing in GitHub.
49+
50+
<!--[metadata]>
51+
+++
52+
title = "Extending services in Compose"
53+
description = "How to use Docker Compose's extends keyword to share configuration between files and projects"
54+
keywords = ["fig, composition, compose, docker, orchestration, documentation, docs"]
55+
[menu.main]
56+
parent="smn_workw_compose"
57+
weight=2
58+
+++
59+
<![end-metadata]-->
60+
61+
The metadata alone has this structure:
62+
63+
+++
64+
title = "Extending services in Compose"
65+
description = "How to use Docker Compose's extends keyword to share configuration between files and projects"
66+
keywords = ["fig, composition, compose, docker, orchestration, documentation, docs"]
67+
[menu.main]
68+
parent="smn_workw_compose"
69+
weight=2
70+
+++
71+
72+
The `[menu.main]` section refers to navigation defined [in the main Docker menu](https://github.com/docker/docs-base/blob/hugo/config.toml). This metadata says *add a menu item called* Extending services in Compose *to the menu with the* `smn_workdw_compose` *identifier*. If you locate the menu in the configuration, you'll find *Create multi-container applications* is the menu title.
73+
74+
You can move an article in the tree by specifying a new parent. You can shift the location of the item by changing its weight. Higher numbers are heavier and shift the item to the bottom of menu. Low or no numbers shift it up.
75+
76+
77+
## Other key documentation repositories
78+
79+
The `docker/docs-base` repository contains [the Hugo theme and menu configuration](https://github.com/docker/docs-base). If you open the `Dockerfile` you'll see the `make docs` relies on this as a base image for building the Compose documentation.
80+
81+
The `docker/docs.docker.com` repository contains [build system for building the Docker documentation site](https://github.com/docker/docs.docker.com). Fork this repository to build the entire documentation site.

docs/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ $ docker-machine ip dev
110110
192.168.99.100
111111
```
112112

113-
For instance, you can try running a webserver ([nginx](https://nginx.org)) in a
113+
For instance, you can try running a webserver ([nginx](https://www.nginx.com/) in a
114114
container with the following command:
115115

116116
```

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ like-minded individuals, we have a number of open channels for communication.
6060
Github](https://github.com/docker/machine/pulls).
6161

6262
For more information and resources, please visit
63-
[https://docs.docker.com/project/get-help/](https://docs.docker.com/project/get-help/).
63+
[our help page](https://docs.docker.com/project/get-help/).
6464

6565
## Where to go next
6666

docs/install-machine.md

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,41 @@ weight=3
99
+++
1010
<![end-metadata]-->
1111

12-
## Install Docker Machine
12+
# Install Docker Machine
1313

1414
Docker Machine is supported on Windows, OS X, and Linux and is installable as
1515
one standalone binary. The links to the binaries for the various platforms and
1616
architectures are available at the [Github
1717
Release](https://github.com/docker/machine/releases/) page.
1818

1919

20-
### OS X and Linux
20+
## OS X and Windows
2121

22-
To install on OS X or Linux, download the proper binary to somewhere in your
23-
`PATH` (e.g. `/usr/local/bin`) and make it executable. For instance, to install on
24-
most OS X machines these commands should suffice:
22+
Install Machine using the Docker Toolbox using the <a href="https://docs.docker.com/installation/mac/" target="_blank">Mac OS X installation</a>
23+
instruction or <a href="https://docs.docker.com/installation/windows" target="_blank">Windows installation</a> instructions.
2524

26-
```
27-
$ curl -L https://github.com/docker/machine/releases/download/v0.3.1/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
28-
$ chmod +x /usr/local/bin/docker-machine
29-
```
25+
## On Linux
3026

31-
For Linux, just substitute "linux" for "darwin" in the binary name above.
27+
To install on Linux, do the following:
3228

33-
Now you should be able to check the version with `docker-machine -v`:
29+
1. Install <a href="https://docs.docker.com/installation/" target="_blank">Docker version 1.7.1 or greater</a>:
3430

35-
```
36-
$ docker-machine -v
37-
machine version 0.3.1
38-
```
31+
2. Download the Machine binary to somewhere in your `PATH` (for example, `/usr/local/bin`).
3932

40-
In order to run Docker commands on your machines without having to use SSH, make
41-
sure to install the Docker client as well, e.g.:
33+
$ curl -L https://github.com/docker/machine/releases/download/v0.4.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine
4234

43-
```
44-
$ curl -L https://get.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local/bin/docker
45-
$ chmod +x /usr/local/bin/docker
46-
```
35+
3. Apply executable permissions to the binary:
4736

48-
### Windows
37+
$ chmod +x /usr/local/bin/docker-machine
4938

50-
Currently, Docker recommends that you install and use Docker Machine on Windows
51-
with [msysgit](https://msysgit.github.io/). This will provide you with some
52-
programs that Docker Machine relies on such as `ssh`, as well as a functioning
53-
shell.
39+
4. Check the installation by displaying the Machine version:
5440

55-
When you have installed msysgit, start up the terminal prompt and run the
56-
following commands. Here it is assumed that you are on a 64-bit Windows
57-
installation. If you are on a 32-bit installation, please substitute "i386" for
58-
"x86_64" in the URLs mentioned.
41+
$ docker-machine -v
42+
machine version 0.4.0
5943

60-
First, install the Docker client binary:
44+
## Where to go next
6145

62-
```
63-
$ curl -L https://get.docker.com/builds/Windows/x86_64/docker-latest.exe > /bin/docker
64-
```
46+
* [Docker Machine overview](/)
47+
* [Docker Machine driver reference](/drivers)
48+
* [Docker Machine subcommand reference](/reference)
6549

66-
Next, install the Docker Machine binary:
67-
68-
```
69-
$ curl -L https://github.com/docker/machine/releases/download/v0.3.1/docker-machine_windows-amd64.exe > /bin/docker-machine
70-
```
71-
72-
Now running `docker-machine` should work.
73-
74-
```
75-
$ docker-machine -v
76-
machine version 0.3.1
77-
```

docs/pre-process.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash -e
2+
3+
# Populate an array with just docker dirs and one with content dirs
4+
docker_dir=(`ls -d /docs/content/docker/*`)
5+
content_dir=(`ls -d /docs/content/*`)
6+
7+
# Loop content not of docker/
8+
#
9+
# Sed to process GitHub Markdown
10+
# 1-2 Remove comment code from metadata block
11+
# 3 Remove .md extension from link text
12+
# 4 Change ](/ to ](/project/ in links
13+
# 5 Change ](word) to ](/project/word)
14+
# 6 Change ](../../ to ](/project/
15+
# 7 Change ](../ to ](/project/word)
16+
#
17+
for i in "${content_dir[@]}"
18+
do
19+
:
20+
case $i in
21+
"/docs/content/windows")
22+
;;
23+
"/docs/content/mac")
24+
;;
25+
"/docs/content/linux")
26+
;;
27+
"/docs/content/docker")
28+
y=${i##*/}
29+
find $i -type f -name "*.md" -exec sed -i.old \
30+
-e '/^<!.*metadata]>/g' \
31+
-e '/^<!.*end-metadata.*>/g' {} \;
32+
;;
33+
*)
34+
y=${i##*/}
35+
find $i -type f -name "*.md" -exec sed -i.old \
36+
-e '/^<!.*metadata]>/g' \
37+
-e '/^<!.*end-metadata.*>/g' \
38+
-e 's/\(\]\)\([(]\)\(\/\)/\1\2\/'$y'\//g' \
39+
-e 's/\(\][(]\)\([A-z].*\)\(\.md\)/\1\/'$y'\/\2/g' \
40+
-e 's/\([(]\)\(.*\)\(\.md\)/\1\2/g' \
41+
-e 's/\(\][(]\)\(\.\/\)/\1\/'$y'\//g' \
42+
-e 's/\(\][(]\)\(\.\.\/\.\.\/\)/\1\/'$y'\//g' \
43+
-e 's/\(\][(]\)\(\.\.\/\)/\1\/'$y'\//g' {} \;
44+
;;
45+
esac
46+
done
47+
48+
#
49+
# Move docker directories to content
50+
#
51+
for i in "${docker_dir[@]}"
52+
do
53+
:
54+
if [ -d $i ]
55+
then
56+
mv $i /docs/content/
57+
fi
58+
done
59+
60+
rm -rf /docs/content/docker
61+

docs/reference/create.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title = "create"
44
description = "Create a machine."
55
keywords = ["machine, create, subcommand"]
66
[menu.main]
7+
identifier="machine.create"
78
parent="smn_machine_subcmds"
89
+++
910
<![end-metadata]-->
@@ -74,8 +75,8 @@ As part of the process of creation, Docker Machine installs Docker and
7475
configures it with some sensible defaults. For instance, it allows connection
7576
from the outside world over TCP with TLS-based encryption and defaults to AUFS
7677
as the [storage
77-
driver](https://docs.docker.com/reference/commandline/cli/#daemon-storage-driver-option)
78-
when available.
78+
driver](https://docs.docker.com/reference/commandline/daemon/#daemon-storage-driver-option) when
79+
available.
7980

8081
There are several cases where the user might want to set options for the created
8182
Docker engine (also known as the Docker _daemon_) themselves. For example, they

docs/reference/inspect.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title = "inspect"
44
description = "Inspect information about a machine"
55
keywords = ["machine, inspect, subcommand"]
66
[menu.main]
7+
identifier="machine.inspect"
78
parent="smn_machine_subcmds"
89
+++
910
<![end-metadata]-->

docs/reference/kill.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title = "kill"
44
description = "Kill (abruptly force stop) a machine."
55
keywords = ["machine, kill, subcommand"]
66
[menu.main]
7+
identifier="machine.kill"
78
parent="smn_machine_subcmds"
89
+++
910
<![end-metadata]-->

docs/reference/restart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title = "restart"
44
description = "Restart a machine"
55
keywords = ["machine, restart, subcommand"]
66
[menu.main]
7+
identifier="machine.restart"
78
parent="smn_machine_subcmds"
89
+++
910
<![end-metadata]-->

0 commit comments

Comments
 (0)
X Tutup