Page 1 of 1

Docker Script/ Container

Posted: 10 Oct 2020 19:41
by chrisgla
Seen multiple threads about Z-Way on Docker and there are multiple containers, but can't see any that have all the persistence links clear or a build script.

Does anyone have a build script or recent container (x86) with persistence?

Re: Docker Script/ Container

Posted: 18 Feb 2021 10:13
by PerH
I'm learning Docker right now, and want to learn how to make an image. If someone could tell me which folders needs to be persistent, i could try an make one? Thinking of an ubuntu docker with 3.1.3.

Re: Docker Script/ Container

Posted: 21 Feb 2021 18:55
by PerH
EDIT: got the solution from @poltos. this image works fine, and is published on dockerhub.

So, I made the docker, but i'm struggling with transferring my system to it.

I tried to copy the /config/ folder to the docker volume, but that doesn't contain info about logon details or room configuration. Can someone help me with getting all necessary info in to run it in the docker?

dockerfile:

Code: Select all

#version of container: 0.1.0
FROM ubuntu:20.04
ENV TZ=Europe/Oslo

#add repository and update the container
#Installation of nesesary package/software for this containers...
RUN DEBIAN_FRONTEND="noninteractive" apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q wget \
                                          libarchive13 \
                                          libxml2 \
                                          sharutils \
                                          tzdata \
                                          gawk \
                                          libc-ares2 \
                                          libavahi-compat-libdnssd-dev \
                                          libwebsockets15 \
                                          libcurl4 \
                                          && apt --fix-broken install && wget https://storage.z-wave.me/z-way-server/z-way-3.1.3_amd64.deb && dpkg -i z-way-*.deb

CMD ["/bin/bash"]

ENV LD_LIBRARY_PATH=/opt/z-way-server/libs
ENV PATH=/opt/z-way-server:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

VOLUME ["/opt/z-way-server/config/zddl"]

VOLUME ["/opt/z-way-server/automation/storage"]

# to allow access from outside of the container  to the container service
# at that ports need to allow access from firewall if need to access it outside of the server.
EXPOSE 8083

WORKDIR /opt/z-way-server

# Use baseimage-docker's init system.
CMD ["z-way-server"]
docker compose:

Code: Select all

version: "3.9"
services:
  Z-Way:
    container_name: Z-Way
    restart: always
    image: perhu/z-way-server-3-1-3:latest
    networks:
      HAnett:
        ipv4_address: 192.168.0.2
    ports:
      - "8083:8083"
    volumes:
      - type: volume
        source: Z-Way-zddl
        target: /opt/z-way-server/config/zddl
      - type: volume
        source: Z-Way-storage
        target: /opt/z-way-server/automation/storage
    devices:
      - "/dev/serial/by-id/usb-0658_0200-if00:/dev/serial/by-id/usb-0658_0200-if00" #your device here
    environment:
      - ZWAY_VERSION=3.1.3
networks:					#I set up a network for the dockers to communicate, with static IPs
    HAnett:
        name: HAnett
        driver: bridge
        ipam:
            config:
                - subnet: 192.168.0.0/16
                  gateway: 192.168.0.254
volumes:
  Z-Way-zddl:
    name: Z-Way-zddl
  Z-Way-storage:
    name: Z-Way-storage