From 3046e489e7dcd9675c8eb585936021795712b31c Mon Sep 17 00:00:00 2001 From: Daniel Glaser <7723396+the78mole@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:28:32 +0200 Subject: [PATCH] Added some docs for docker installation --- docs/installation.rst | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/installation.rst b/docs/installation.rst index dec1294..43d6bdd 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -130,6 +130,8 @@ It is now possible to start, stop, restart and check the status of sml2mqtt with Docker ====================================== +Stable release (currently 2.2) +------------------------------ Installation through `docker `_ is available: @@ -143,3 +145,45 @@ There the ``config.yml`` will be used or a new ``config.yml`` will be created The analyze option can also be set through an environment variable (see :ref:`command line interface `). + +Easiest way to run a docker with a locally mounted volume: + + mkdir sml2mqtt + docker run -v $(pwd)/sml2mqtt:/sml2mqtt spacemanspiff2007/sml2mqtt:latest + # This will quit after a few seconds (with an error on the logs at sml2mqtt/sml2mqtt.log) + vi sml2mqtt/config.yml + # Edit the config according to your needs + docker run -v $(pwd)/sml2mqtt:/sml2mqtt spacemanspiff2007/sml2mqtt:latest + # This schould now continue running, check with + docker ps + +Building the docker image from source +------------------------------------- + +First you need to create a fresh docker image, then it is mostly similar to the above. + + cd ~ + mkdir GIT + cd GIT + git clone https://github.com/spacemanspiff2007/sml2mqtt.git + cd sml2mqtt + docker built -t sml2mqtt . + cd ~ + mkdir -p dockerdata/sml2mqtt + cd dockerdata + docker run -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt + + # This will quit after a few seconds (with an error on the logs at + # sml2mqtt/sml2mqtt.log) + # Now edit the config according to your needs and start again + vi sml2mqtt/config.yml + docker run -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt + + # This schould now continue running, if everything runs for a minute + # interrupt it with Ctrl-C and start the container in detached mode + docker run -d -v $(pwd)/sml2mqtt:/sml2mqtt sml2mqtt + + # Check if it is running + docker ps -a + +You can further adjust the config to process the values and restart docker... \ No newline at end of file