Skip to content

Commit

Permalink
Added some docs for docker installation
Browse files Browse the repository at this point in the history
  • Loading branch information
the78mole committed Apr 25, 2024
1 parent 78d9c07 commit 3046e48
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://hub.docker.com/r/spacemanspiff2007/sml2mqtt>`_ is available:

Expand All @@ -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 <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...

0 comments on commit 3046e48

Please sign in to comment.