Skip to content

Commit 222fc6d

Browse files
committed
docs(readme): move to docs/ directory and modify accordingly
1 parent dce112a commit 222fc6d

File tree

1 file changed

+81
-26
lines changed

1 file changed

+81
-26
lines changed

README.rst renamed to docs/README.rst

Lines changed: 81 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,52 @@
1-
======
1+
.. _readme:
2+
23
Docker
34
======
45

6+
|img_travis| |img_sr|
7+
8+
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/docker-formula.svg?branch=master
9+
:alt: Travis CI Build Status
10+
:scale: 100%
11+
:target: https://travis-ci.com/saltstack-formulas/docker-formula
12+
.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
13+
:alt: Semantic Release
14+
:scale: 100%
15+
:target: https://github.com/semantic-release/semantic-release
16+
517
Formulas for working with Docker
618

7-
.. note::
19+
.. contents:: **Table of Contents**
20+
21+
General notes
22+
-------------
23+
24+
See the full `SaltStack Formulas installation and usage instructions
25+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
826

9-
See the full `Salt Formulas installation and usage instructions
10-
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
27+
If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
28+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
29+
30+
If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
31+
which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
32+
33+
See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
34+
35+
Contributing to this repo
36+
-------------------------
37+
38+
**Commit message formatting is significant!!**
39+
40+
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
1141

1242
Available states
13-
================
43+
----------------
1444

1545
.. contents::
1646
:local:
1747

1848
``docker``
19-
----------
49+
^^^^^^^^^^
2050

2151
Install and run Docker daemon
2252

@@ -30,7 +60,7 @@ Install and run Docker daemon
3060

3161

3262
``docker.containers``
33-
---------------------
63+
^^^^^^^^^^^^^^^^^^^^^
3464

3565
Pulls and runs a number of docker containers with arbitrary *run* options all configurable via pillars.
3666
Salt includes *dockerio* and *dockerng* states, but both depend on *docker-py* library, which not always implements the latest *docker run* options. This gives the user more control over the docker run options, but it doesn't try to implement all the other docker commands, such as build, ps, inspect, etc. It just pulls an image and runs it.
@@ -71,34 +101,34 @@ In the example pillar above:
71101
- ``service <container_name> stop`` will wipeout the container completely (ie ``docker stop <container_name> + docker rm <container_name>``)
72102

73103
``docker.clean``
74-
----------------
104+
^^^^^^^^^^^^^^^^
75105

76106
Stop Docker daemon and remove older docker packages (usually called 'docker' and 'docker-engine'). Linux only.
77107

78108
``docker.repo``
79-
---------------
109+
^^^^^^^^^^^^^^^
80110

81111
Configures the upstream docker's repo (true, by default).
82112

83113
``docker.macosapp``
84-
-------------------
114+
^^^^^^^^^^^^^^^^^^^
85115

86116
Installs Docker Desktop for Mac.
87117

88118
``docker.macosapp``
89-
-------------------
119+
^^^^^^^^^^^^^^^^^^^
90120

91121
Installs Docker Desktop for Mac.
92122

93123
``docker.compose``
94-
------------------
124+
^^^^^^^^^^^^^^^^^^
95125

96126
Installs `Docker Compose <https://docs.docker.com/compose/>`_
97127
(previously ``fig``) to define groups of containers and their relationships
98128
with one another. Use `docker.compose-ng` to run `docker-compose`.
99129

100130
``docker.compose-ng``
101-
---------------------
131+
^^^^^^^^^^^^^^^^^^^^^
102132

103133
The intent is to provide an interface similar to the `specification <https://docs.docker.com/compose/compose-file/>`_
104134
provided by docker-compose. The hope is that you may provide pillar data
@@ -162,7 +192,7 @@ Then you would target a host with the following states:
162192
163193
164194
``docker.registry (DEPRECATED)``
165-
--------------------------------
195+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166196

167197
NEW:
168198

@@ -201,32 +231,57 @@ In this case, extra *docker run* options can be provided in your *"registry:look
201231
By default, the storage backend used by the registry is "filesystem". Use environment variables to override that, for example to use S3 as backend storage.
202232

203233
``docker.remove``
204-
----------------
234+
^^^^^^^^^^^^^^^^^
205235

206236
Stop Docker daemon. Remove older docker packages (usually called 'docker' and 'docker-engine').
207237

208238
Development
209-
===========
239+
-----------
210240

211241
Note that some of the internal states such as `docker.running` are references to the internal `dockerio states <https://docs.saltstack.com/en/latest/ref/states/all/salt.states.dockerio.html>`_
212242

213243

214244
Testing
215-
=======
245+
-------
216246

217-
Testing is done with `Test Kitchen <http://kitchen.ci/>`_
218-
for machine setup and `testinfra <https://testinfra.readthedocs.io/en/latest/>`_
219-
for integration tests.
247+
Linux testing is done with ``kitchen-salt``.
220248

221249
Requirements
222-
------------
250+
^^^^^^^^^^^^
223251

224-
* Python
225252
* Ruby
226253
* Docker
227254

228-
::
255+
.. code-block:: bash
256+
257+
$ gem install bundler
258+
$ bundle install
259+
$ bin/kitchen test [platform]
260+
261+
Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
262+
e.g. ``debian-9-2019-2-py3``.
263+
264+
``bin/kitchen converge``
265+
^^^^^^^^^^^^^^^^^^^^^^^^
266+
267+
Creates the docker instance and runs the ``template`` main state, ready for testing.
268+
269+
``bin/kitchen verify``
270+
^^^^^^^^^^^^^^^^^^^^^^
271+
272+
Runs the ``inspec`` tests on the actual instance.
273+
274+
``bin/kitchen destroy``
275+
^^^^^^^^^^^^^^^^^^^^^^^
276+
277+
Removes the docker instance.
278+
279+
``bin/kitchen test``
280+
^^^^^^^^^^^^^^^^^^^^
281+
282+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
283+
284+
``bin/kitchen login``
285+
^^^^^^^^^^^^^^^^^^^^^
229286

230-
gem install bundler
231-
bundle install
232-
kitchen test
287+
Gives you SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)