-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-rpi
95 lines (81 loc) · 4.52 KB
/
Dockerfile-rpi
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
84
85
86
87
88
89
90
91
92
93
94
95
FROM balenalib/armv7hf-debian:buster
# Enable building ARM container on x86 machinery on the web (comment out next line if built on Raspberry)
RUN [ "cross-build-start" ]
# Following lines are from original Docker image : https://github.com/jeedom/core/blob/release/Dockerfile
ENV SHELL_ROOT_PASSWORD Mjeedom96
ENV APACHE_PORT 80
ENV SSH_PORT 2222
ENV MODE_HOST 0
# NOTE : default-mysql-client instead of mysql-client (not found on rpi build)
RUN apt-get update && apt-get install -y wget openssh-server supervisor default-mysql-client
# Install
RUN echo "root:${SHELL_ROOT_PASSWORD}" | chpasswd && \
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
RUN mkdir -p /var/run/sshd /var/log/supervisor
WORKDIR /etc
RUN rm /etc/motd && wget -q https://raw.githubusercontent.com/jeedom/core/release/install/motd
WORKDIR /etc/supervisor/conf.d
RUN wget -q https://raw.githubusercontent.com/jeedom/core/release/install/OS_specific/Docker/supervisord.conf
WORKDIR /root
RUN rm -f /root/.bashrc && wget -O .bashrc -q https://raw.githubusercontent.com/jeedom/core/release/install/bashrc
RUN wget -O install_docker.sh -q https://raw.githubusercontent.com/jeedom/core/release/install/install.sh && chmod +x /root/install_docker.sh
RUN /root/install_docker.sh -s 1;exit 0
RUN /root/install_docker.sh -s 2;exit 0
RUN /root/install_docker.sh -s 4;exit 0
RUN /root/install_docker.sh -s 5;exit 0
RUN /root/install_docker.sh -s 7;exit 0
RUN /root/install_docker.sh -s 10;exit 0
RUN systemctl disable apache2;exit 0
RUN systemctl disable sshd;exit 0
RUN wget -q https://raw.githubusercontent.com/jeedom/core/release/install/OS_specific/Docker/init.sh && chmod +x /root/init.sh
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
CMD ["/root/init.sh"]
# Preload homebridge install script
RUN mkdir -p /tmp/homebridge/resources
ADD plugins/homebridge/install_homebridge.sh /tmp/homebridge/resources/install_homebridge.sh
# Install script for additional setup
ADD install/setup.sh /root/setup.sh
## Preinstall dependencies
RUN export DEBIAN_FRONTEND=noninteractive && \
# RFlink needs nodejs at least v14
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && \
# Update base image
apt-get update && apt-get -y dist-upgrade && \
# Mysql client & git && dumb-init
apt-get install --no-install-recommends -y default-mysql-client git dumb-init && \
# Plugin Network : fix ping
apt-get install --no-install-recommends -y iputils-ping && \
# Plugin Z wave
# RPI : pre-install build dependencies on rpi
apt-get install --no-install-recommends -y git python3-pip python-dev python-pyudev python-setuptools python-louie python-lxml \
make build-essential libudev-dev g++ gcc python-lxml unzip libjpeg-dev python-serial python-requests && \
pip install wheel urwid louie six tornado && \
# end of RPI
mkdir -p /tmp/jeedom/openzwave/ && cd /tmp && \
git clone https://github.com/jeedom/plugin-openzwave.git && cd plugin-openzwave && git checkout master && cd resources && \
chmod u+x ./install_apt.sh && ./install_apt.sh && cd /tmp && rm -Rf plugin-openzwave && \
# Plugin Homebridge
cd /tmp/homebridge/resources && chmod u+x ./install_homebridge.sh && ./install_homebridge.sh && cd /tmp && \
# Camera
# Note: libav-tools python-imaging are deprecated
apt-get install --no-install-recommends -y ffmpeg python-pil php-gd && \
# Freebox OS
apt-get install --no-install-recommends -y android-tools-adb netcat && \
# PlayTTS
apt-get install --no-install-recommends -y libsox-fmt-mp3 sox libttspico-utils mplayer mpg123 lsb-release software-properties-common && \
cd /tmp && \
git clone https://github.com/lunarok/jeedom_playtts.git && cd jeedom_playtts && git checkout master && cd resources && \
sed -i 's/sudo usermod -a -G audio `whoami`/sudo usermod -a -G audio www-data/' ./install.sh && \
chmod u+x ./install.sh && ./install.sh && cd /tmp && rm -Rf jeedom_playtts && \
# RFlink needs nodejs at least v12
apt-get install --no-install-recommends -y nodejs avrdude && \
npm install && ln -s `which node` `which node`js && \
# Reduce image size
apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* && \
#Setup
sed -i 's/.*service atd restart.*/service atd restart\n. \/root\/setup.sh/' /root/init.sh
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["sh", "/root/init.sh"]
# stop processing ARM emulation (comment out next line if built on Raspberry)
RUN [ "cross-build-end" ]