forked from buanet/ioBroker.docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (71 loc) · 2.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM debian:latest
MAINTAINER Andre Germann <https://buanet.de>
ENV DEBIAN_FRONTEND noninteractive
# Install prerequisites
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
acl \
apt-utils \
build-essential \
curl \
git \
gnupg2 \
libavahi-compat-libdnssd-dev \
libcap2-bin \
libpam0g-dev \
libudev-dev \
locales \
procps \
python \
sudo \
unzip \
wget \
nano \
&& rm -rf /var/lib/apt/lists/*
# Install node8
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get update && apt-get install -y \
nodejs \
&& rm -rf /var/lib/apt/lists/*
# Configure locales/ language/ timezone
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& \dpkg-reconfigure --frontend=noninteractive locales \
&& \update-locale LANG=de_DE.UTF-8
RUN cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
# Create scripts directory and copy scripts
RUN mkdir -p /opt/scripts/ \
&& chmod 777 /opt/scripts/
WORKDIR /opt/scripts/
COPY scripts/avahi_startup.sh avahi_startup.sh
COPY scripts/iobroker_startup.sh iobroker_startup.sh
COPY maintenance_scripts/iobroker_restart.sh iobroker_restart.sh
COPY maintenance_scripts/iobroker_stop.sh iobroker_stop.sh
COPY scripts/packages_install.sh packages_install.sh
RUN chmod +x avahi_startup.sh \
&& chmod +x iobroker_startup.sh \
&& chmod +x iobroker_restart.sh \
&& chmod +x iobroker_stop.sh \
&& chmod +x packages_install.sh
# Install ioBroker
WORKDIR /
RUN apt-get update \
&& curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \
&& echo $(hostname) > /opt/iobroker/.install_host \
&& rm -rf /var/lib/apt/lists/*
# Install node-gyp
WORKDIR /opt/iobroker/
RUN npm install -g node-gyp
# Backup initial ioBroker-folder
RUN tar -cf /opt/initial_iobroker.tar /opt/iobroker
# Giving iobroker-user sudo rights
RUN echo 'iobroker ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo \
&& echo "iobroker:iobroker" | chpasswd \
&& adduser iobroker sudo
USER iobroker
# Setting up ENV
ENV DEBIAN_FRONTEND="teletype" \
LANG="de_DE.UTF-8" \
TZ="Europe/Berlin" \
PACKAGES="nano" \
AVAHI="true"
# Run startup-script
CMD ["sh", "/opt/scripts/iobroker_startup.sh"]