Skip to content

Commit 14e0230

Browse files
committed
Added some docs for docker installation
1 parent 78d9c07 commit 14e0230

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/installation.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ It is now possible to start, stop, restart and check the status of sml2mqtt with
130130
Docker
131131
======================================
132132

133+
Stable release (currently 2.2)
134+
------------------------------
133135

134136
Installation through `docker <https://hub.docker.com/r/spacemanspiff2007/sml2mqtt>`_ is available:
135137

@@ -143,3 +145,49 @@ There the ``config.yml`` will be used or a new ``config.yml`` will be created
143145

144146
The analyze option can also be set through an environment variable
145147
(see :ref:`command line interface <COMMAND_LINE_INTERFACE>`).
148+
149+
Easiest way to run a docker with a locally mounted volume:
150+
151+
.. code-block:: bash
152+
153+
mkdir sml2mqtt
154+
docker run -v $(pwd)/sml2mqtt:/sml2mqtt spacemanspiff2007/sml2mqtt:latest
155+
# This will quit after a few seconds (with an error on the logs at sml2mqtt/sml2mqtt.log)
156+
vi sml2mqtt/config.yml
157+
# Edit the config according to your needs
158+
docker run -v $(pwd)/sml2mqtt:/sml2mqtt spacemanspiff2007/sml2mqtt:latest
159+
# This schould now continue running, check with
160+
docker ps
161+
162+
Building the docker image from source
163+
-------------------------------------
164+
165+
First you need to create a fresh docker image, then it is mostly similar to the above.
166+
167+
.. code-block:: bash
168+
169+
cd ~
170+
mkdir GIT
171+
cd GIT
172+
git clone https://github.com/spacemanspiff2007/sml2mqtt.git
173+
cd sml2mqtt
174+
docker built -t sml2mqtt .
175+
cd ~
176+
mkdir -p dockerdata/sml2mqtt
177+
cd dockerdata
178+
docker run -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt
179+
180+
# This will quit after a few seconds (with an error on the logs at
181+
# sml2mqtt/sml2mqtt.log)
182+
# Now edit the config according to your needs and start again
183+
vi sml2mqtt/config.yml
184+
docker run -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt
185+
186+
# This schould now continue running, if everything runs for a minute
187+
# interrupt it with Ctrl-C and start the container in detached mode
188+
docker run -d -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt
189+
190+
# Check if it is running
191+
docker ps -a
192+
193+
You can further adjust the config to process the values and restart docker...

0 commit comments

Comments
 (0)