Add tty true for compatibility with the openHAB 2.2 (#103)

Add tty true to make sure the example is compatible with version 2.2 of openHAB

Fixes #102

Signed-off-by: Martin van Wingerden <martinvw@mtin.nl>
pull/104/head^2
Martin van Wingerden 2017-09-14 16:13:36 +02:00 committed by Christian Häussler
parent e566484125
commit 1a4920cd83
1 changed files with 40 additions and 30 deletions

View File

@ -73,6 +73,7 @@ Following configuration uses Docker named data volumes. These volumes will survi
docker run \ docker run \
--name openhab \ --name openhab \
--net=host \ --net=host \
--tty \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \ -v /etc/timezone:/etc/timezone:ro \
-v openhab_addons:/openhab/addons \ -v openhab_addons:/openhab/addons \
@ -88,19 +89,23 @@ docker run \
Create the following ``docker-compose.yml`` and start the container with ``docker-compose up -d`` Create the following ``docker-compose.yml`` and start the container with ``docker-compose up -d``
```YAML ```YAML
openhab: version: '2.1'
image: "openhab/openhab:2.1.0-amd64"
restart: always services:
net: host openhab:
volumes: image: "openhab/openhab:2.1.0-amd64"
- "/etc/localtime:/etc/localtime:ro" restart: always
- "/etc/timezone:/etc/timezone:ro" network_mode: host
- "openhab_addons:/openhab/addons" tty: true
- "openhab_conf:/openhab/conf" volumes:
- "openhab_userdata:/openhab/userdata" - "/etc/localtime:/etc/localtime:ro"
environment: - "/etc/timezone:/etc/timezone:ro"
OPENHAB_HTTP_PORT: "8080" - "openhab_addons:/openhab/addons"
OPENHAB_HTTPS_PORT: "8443" - "openhab_conf:/openhab/conf"
- "openhab_userdata:/openhab/userdata"
environment:
OPENHAB_HTTP_PORT: "8080"
OPENHAB_HTTPS_PORT: "8443"
``` ```
#### Running openHAB with libpcap support #### Running openHAB with libpcap support
@ -108,23 +113,27 @@ openhab:
You can run all openHAB images with libpcap support. This enables you to use the *Amazon Dashbutton Binding* in the Docker container. For that feature to work correctly, you need to run the image as **root user**. Create the following ``docker-compose.yml`` and start the container with ``docker-compose up -d`` You can run all openHAB images with libpcap support. This enables you to use the *Amazon Dashbutton Binding* in the Docker container. For that feature to work correctly, you need to run the image as **root user**. Create the following ``docker-compose.yml`` and start the container with ``docker-compose up -d``
```YAML ```YAML
openhab: version: '2.1'
container_name: openhab
image: "openhab/openhab:2.1.0-amd64" services:
restart: always openhab:
net: host container_name: openhab
cap_add: image: "openhab/openhab:2.1.0-amd64"
- NET_ADMIN restart: always
- NET_RAW tty: true
volumes: net: host
- "/etc/localtime:/etc/localtime:ro" cap_add:
- "/etc/timezone:/etc/timezone:ro" - NET_ADMIN
- "openhab_conf:/openhab/conf" - NET_RAW
- "openhab_userdata:/openhab/userdata" volumes:
- "openhab_addons:/openhab/addons" - "/etc/localtime:/etc/localtime:ro"
# The command node is very important. It overrides - "/etc/timezone:/etc/timezone:ro"
# the "gosu openhab ./start.sh" command from Dockerfile and runs as root! - "openhab_conf:/openhab/conf"
command: "./start.sh" - "openhab_userdata:/openhab/userdata"
- "openhab_addons:/openhab/addons"
# The command node is very important. It overrides
# the "gosu openhab ./start.sh" command from Dockerfile and runs as root!
command: "./start.sh"
``` ```
*If you could provide a method to run libpcap support in user mode please open a pull request.* *If you could provide a method to run libpcap support in user mode please open a pull request.*
@ -136,6 +145,7 @@ You can mount a local host directory to store your configuration files. If you f
docker run \ docker run \
--name openhab \ --name openhab \
--net=host \ --net=host \
--tty \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \ -v /etc/timezone:/etc/timezone:ro \
-v /opt/openhab/addons:/openhab/addons \ -v /opt/openhab/addons:/openhab/addons \