Skip to content

Commit a5ab812

Browse files
committed
contrib: add guidelines for contributing Docker guides
Signed-off-by: David Karlsson <[email protected]>
1 parent 35b4dbf commit a5ab812

File tree

1 file changed

+251
-0
lines changed

1 file changed

+251
-0
lines changed

content/contribute/guides.md

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
---
2+
title: Guidelines for writing Docker usage guides
3+
linkTitle: Write a Docker guide
4+
description: Learn how to write guides for learning about Docker, with Docker.
5+
---
6+
7+
<!-- vale Docker.We = NO -->
8+
9+
This guide provides instructions and best practices for writing tutorial-style
10+
usage guides that help users achieve specific goals using Docker. These guides
11+
will be featured in the [guides section](/guides/_index.md) of the website,
12+
alongside our product manuals and reference materials.
13+
14+
Our documentation is written in Markdown, with YAML front matter for metadata.
15+
We use [Hugo](https://gohugo.io) to build the website. For more information
16+
about how to write content for Docker docs, refer to our
17+
[CONTRIBUTING.md](https://github.com/docker/docs/tree/main/CONTRIBUTING.md).
18+
19+
## Purpose of the guides
20+
21+
Our usage guides aim to:
22+
23+
- Educate users on how to leverage Docker in various contexts.
24+
- Provide practical, hands-on experience through step-by-step tutorials.
25+
- Help users achieve specific goals relevant to their interests or projects.
26+
27+
## Audience
28+
29+
- Experience levels: From beginners to advanced users.
30+
- Roles: Developers, system administrators, DevOps engineers, and more.
31+
- Technologies: Various programming languages and frameworks.
32+
33+
## Metadata for guides
34+
35+
Each guide must include a metadata section at the beginning of the document.
36+
This metadata helps users discover and filter guides based on their interests
37+
and needs.
38+
39+
### Example metadata format
40+
41+
```yaml
42+
---
43+
title: Deploy a machine learning model with Docker
44+
linkTitle: Docker for ML deployment
45+
description: Learn how to containerize and deploy a machine learning model using Docker.
46+
summary: |
47+
This guide walks you through the steps to containerize a machine learning
48+
model and deploy it using Docker, enabling scalable and portable AI
49+
solutions.
50+
languages: [python]
51+
subjects: [machine-learning, deployment]
52+
levels: [intermediate]
53+
params:
54+
time: 30 minutes
55+
---
56+
```
57+
58+
### Metadata fields
59+
60+
- `title` (required): The main title of the guide in sentence case.
61+
- `linkTitle` (optional): A shorter title used in navigation menus.
62+
- `description` (required): A concise description for SEO purposes.
63+
- `summary` (required): A brief overview of the guide's content.
64+
- `languages` (optional): List of programming languages used.
65+
- `subjects` (optional): Domains or subject areas covered.
66+
- `levels` (optional): Intended audience experience level (`beginner`, `intermediate`, `advanced`).
67+
- `params`
68+
- `time` (optional): Estimated reading or completion time.
69+
70+
## Document structure
71+
72+
Our guides emphasize learning by doing. Depending on the type of guide, the
73+
structure may vary to best suit the content and provide a smooth learning
74+
experience.
75+
76+
All guides live directly under the `content/guides/` directory in the Docker
77+
docs repository. Guides can either be a single page or multiple pages. In the
78+
case of multi-page guides, every page is a step in a sequential workflow.
79+
80+
If you're creating a single-page guide, create a single markdown file in the
81+
guides directory:
82+
83+
```bash
84+
# Create the file
85+
touch content/guides/my-docker-guide.md
86+
# or if you have Hugo installed:
87+
hugo new content/guides/my-docker-guide.md
88+
```
89+
90+
To create a multi-page guide, create a directory where each page is a markdown
91+
file, with an `_index.md` file representing the introduction to the guide.
92+
93+
```bash
94+
# Create the index page for the guide
95+
mkdir content/guides/my-docker-guide.md
96+
touch content/guides/my-docker-guide/_index.md
97+
# or if you have Hugo installed:
98+
hugo new content/guides/my-docker-guide/_index.md
99+
```
100+
101+
Then create the pages for the guide under `content/guides/<dir>/<page>.md` as
102+
needed. The [metadata](#metadata-for-guides) lives on the `_index.md` page (you
103+
don't need to assign metadata to individual pages).
104+
105+
### Guides for specific frameworks or languages
106+
107+
For guides that demonstrate how to use Docker with a particular framework or
108+
programming language, consider the following outline:
109+
110+
1. **Introduction**
111+
- Briefly introduce the framework or language in the context of Docker.
112+
- Explain what the user will achieve by the end of the guide.
113+
- List required software, tools, and knowledge.
114+
2. **Development setup**
115+
- Guide the user through setting up a development environment.
116+
- Include instructions on writing or obtaining sample code.
117+
- Show how to run containers for local development.
118+
3. **Building the application**
119+
- Explain how to create a Dockerfile tailored to the application.
120+
- Provide step-by-step instructions for building the Docker image.
121+
- If applicable, show how to test the application using Docker.
122+
4. **Deploying with Docker**
123+
- Show how to run the application in a Docker container.
124+
- Discuss configuration options and best practices.
125+
5. **Best practices and conclusions**
126+
- Offer tips for optimizing Docker usage with the framework or language.
127+
- Summarize key takeaways, suggest next steps, and further reading.
128+
129+
### Use-case guides
130+
131+
For guides focused on accomplishing a specific goal or use case with Docker
132+
(e.g., deploying a machine learning model), use a flexible outline that ensures
133+
a logical flow.
134+
135+
The following outline is an example. The structure should be adjusted to best
136+
fit the content and ensure a clear, logical progression. Depending on the
137+
subject matter of your use-case guide, the exact structure will vary.
138+
139+
1. **Introduction**
140+
- Describe the problem or goal.
141+
- Explain the benefits of using Docker in this context.
142+
2. **Prerequisites**
143+
- List required tools, technologies, and prior knowledge.
144+
3. **Setup**
145+
- Provide instructions for setting up the environment.
146+
- Include any necessary configuration steps.
147+
4. **Implementation**
148+
- Walk through the process step by step.
149+
- Use code snippets and explanations to illustrate key points.
150+
5. **Running or deploying the application**
151+
- Guide the user on how to execute or deploy the solution.
152+
- Discuss any verification steps to ensure success.
153+
6. **Conclusion**
154+
- Recap what was achieved.
155+
- Suggest further reading or advanced topics.
156+
157+
## Example code
158+
159+
If you create an example repository with source code to accompany your guide,
160+
we strongly encourage you to publish that repository under the
161+
[dockersamples](https://github.com/dockersamples) organization on GitHub.
162+
Publishing your source code under this organization, rather than your personal
163+
account, ensures that the source code remains accessible to the maintainers of
164+
the documentation site after publishing. In the event of a bug or an issue in
165+
the guide, the documentation team can more easily update the guide and its
166+
corresponding example repository.
167+
168+
Hosting the examples in the official samples namespace also helps secure trust
169+
with users who are reading the guide.
170+
171+
### Publish a repository under `dockersamples`
172+
173+
To publish your repository under the `dockersamples` organization, use the
174+
[dockersamples template](https://github.com/dockersamples/sample-app-template)
175+
to initiate a sample repository under your personal namespace. When you've
176+
finished drafting your content and opened your pull request for the
177+
documentation, we can transfer the repository to the dockersamples
178+
organization.
179+
180+
## Writing style
181+
182+
Use [sentence case](/contribute/style/formatting.md#capitalization) for all
183+
headings and titles. This means only the first word and proper nouns are
184+
capitalized.
185+
186+
### Voice and tone
187+
188+
- **Clarity and conciseness**: Use simple language and short sentences to convey information effectively.
189+
- **Active voice**: Write in the active voice to engage the reader (e.g., "Run the command" instead of "The command should be run").
190+
- **Consistency**: Maintain a consistent tone and terminology throughout the guide.
191+
192+
For detailed guidelines, refer to our [voice and tone documentation](/contribute/style/voice-tone.md).
193+
194+
### Formatting conventions
195+
196+
- **Headings**: Use H2 for main sections and H3 for subsections, following sentence case.
197+
- **Code examples**: Provide complete, working code snippets with syntax highlighting.
198+
- **Lists and steps**: Use numbered lists for sequential steps and bullet points for non-sequential information.
199+
- **Emphasis**: Use bold for UI elements (e.g., **Button**), and italics for emphasis.
200+
- **Links**: Use descriptive link text (e.g., [Install Docker](/get-started/get-docker.md)).
201+
202+
For more details, see our [content formatting guidelines](/contribute/style/formatting.md)
203+
and [grammar and style rules](/contribute/style/grammar.md).
204+
205+
## Best practices
206+
207+
- **Test all instructions**
208+
- Ensure all code and commands work as expected.
209+
- Verify that the guide can be followed successfully from start to finish.
210+
- **Relevance**
211+
- Focus on real-world applications and scenarios.
212+
- Keep the content up-to-date with the latest Docker versions.
213+
- **Troubleshooting tips**
214+
- Anticipate common issues and provide solutions or references.
215+
- **Visual aids**
216+
- Include screenshots or diagrams where they enhance understanding.
217+
- Add captions and alt text for accessibility.
218+
219+
## Additional resources
220+
221+
- **Existing guides**
222+
- Refer to [Docker Guides](/guides/_index.md) for examples and inspiration.
223+
- **Style guides**
224+
- [Voice and tone](/contribute/style/voice-tone.md)
225+
- [Content formatting](/contribute/style/formatting.md)
226+
- [Grammar and style](/contribute/style/grammar.md)
227+
228+
## Submission process
229+
230+
- **Proposal**
231+
- Raise an issue on the [Docker documentation GitHub repository](https://github.com/docker/docs)
232+
with a request to add a new guide.
233+
- Once the proposal has been accepted, start writing your guide by forking
234+
the repository and creating a branch for your work.
235+
236+
> [!NOTE]
237+
> Avoid contributing from the `main` branch of your fork, since it makes it
238+
> more difficult for maintainers to help you fix any issues that may arise.
239+
240+
- **Review**
241+
- Proofread your guide for grammar, clarity, and adherence to the guidelines.
242+
- Once your draft is ready, raise a pull request, with a reference to the
243+
original issue.
244+
- The Docker documentation team and subject matter experts will review your
245+
submission and provide feedback on the pull request directly.
246+
- **Publishing**
247+
- Your guide will be published on the Docker documentation website when the
248+
reviewers have approved and merged your pull request.
249+
250+
Thank you for contributing to the Docker community. Your expertise helps users
251+
worldwide harness the power of Docker.

0 commit comments

Comments
 (0)