Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 1.45 KB

README_Docker.md

File metadata and controls

42 lines (35 loc) · 1.45 KB

Running OpenSprinkler via Docker

Before trying to build the docker image, you need to download the submodules. You can do it via:

git submodule update --recursive --init

Building the container

From this directory, create the image:

$ docker build -t opensprinkler .

Notes:

  • This requires a version of Docker that supports multi-stage builds (i.e., version >= 17.06).
  • The container is built for the armhf architecture.

Running the container

Once the container is built, it can be started via:

$ mkdir ~/opensprinkler
$ docker run -d \
  --name opensprinkler \   # Give it a handy name
  --privileged \           # Privileged because we need access to devices
  --publish 8080:8080 \    # Make the web interface accessible
  --restart always \       # Auto restart on crash/exit
  --volume /dev:/dev \     # Provide access to /dev
  --volume ~/opensprinkler:/data \  # Where to save NVM & logs
  opensprinkler            # The image (from above)

The persistent data generated by OS is written to the volume mounted at /data within the container. This includes the NVM files, IFTTT key file, and log directory. In the above sample command line, these files will end up in the user's home directory (${HOME}/opensprinkler). Other options, including using a docker data volume are possible. NOTE: If you don't specify a volume or dir to mount here, your OpenSprinkler configuration will not persist across restarts of the container.