infiniteloop-inc / crystal-signal

BSD 3-Clause "New" or "Revised" License
19 stars 10 forks source link

[要望]Dockerコンテナ化 #10

Open yuhkan opened 6 years ago

yuhkan commented 6 years ago

お世話になっております。 掲題のとおりなのですが、スクリプト、アプリ等をDockerのコンテナ化できないでしょうか?

実際、そのような試みを行っている方もいて、その方の環境では動作しているようなのですが、 私の環境では構築に失敗し、手動でのインストールも試みましたが、やはりうまくいかない状態です。 (私の知識、理解不足によるところが大きいと思うのですが……) 参考:https://azriton.github.io/2017/04/14/CrystalSignalPi-on-Docker/

Raspberry piを利用した様々な実験を行いつつ、シグナル機能は並立させたいというとき、コンテナ化されているというのは非常に魅力的で(なんどもfullinstallしなくて良い!)、 公式の機能としてサポートされていれば、非常に利用しやすくなるのではないかと思います。

ちなみに、Raspbian/jessieのイメージに、現行のインストール方法でfullinstallを行った場合、最終段において以下のようなエラーとなります。 2017-11-25 17:39:13 (2.22 MB/s) - ‘/var/www/html/js/bootstrap-slider-9.5.1.min.js’ saved [35789/35789]

Created symlink from /etc/systemd/system/multi-user.target.wants/LEDController.service to /etc/systemd/system/LEDController.service. Failed to get D-Bus connection: Unknown error -1 FINISHED

T-Kuhn commented 6 years ago

yuhkanさん、こんにちは。 ご要望ありがとうございます。Dockerの導入を検討します。

Failed to get D-Bus connection: Unknown error -1

上記エラーメッセージに関しては、Docker内でインストールを行った際に出たエラー、という理解でいいでしょうか?もしそうだとすると、Dockerコンテナの中ではPID1としてinitが動いてないことが原因だと考えられます。

8yazaki commented 6 years ago

initをPID1で起動するように「--init」オプションをつけて起動させてからinstall.shを実行しましたが、yuhkanさんと同じエラーがでてしまいました。

インストール時の全ログ

root@85667d734367:/usr/local/etc# curl -O https://raw.githubusercontent.com/infiniteloop-inc/crystal-signal/master/install.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--100 9340 100 9340 0 0 25064 0 --:--:-- --:--:-- --:--:-- 25107 root@85667d734367:/usr/local/etc# sudo bash install.sh Hit http://archive.raspberrypi.org jessie InRelease
Hit http://archive.raspbian.org jessie InRelease
Get:1 http://archive.raspberrypi.org jessie/main armhf Packages [171 kB] Get:2 http://archive.raspbian.org jessie/main armhf Packages [13.3 MB] Get:3 http://archive.raspbian.org jessie/contrib armhf Packages [49.5 kB] Get:4 http://archive.raspbian.org jessie/non-free armhf Packages [101 kB] Get:5 http://archive.raspbian.org jessie/rpi armhf Packages [1297 B] Get:6 http://archive.raspbian.org jessie/firmware armhf Packages [1202 B] Fetched 13.6 MB in 16s (829 kB/s)
Reading package lists... Done Building dependency tree
Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree
Reading state information... Done The following extra packages will be installed: libexpat1 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libsqlite3-0 mime-support python python-minimal python2.7 python2.7-minimal Suggested packages: python-doc python-tk python2.7-doc binutils binfmt-support Recommended packages: file The following NEW packages will be installed: libexpat1 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libsqlite3-0 mime-support pigpio python python-minimal python-pigpio python2.7 python2.7-minimal 0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded. Need to get 4504 kB of archives. After this operation, 17.8 MB of additional disk space will be used. Get:1 http://archive.raspbian.org/raspbian/ jessie/main libsqlite3-0 armhf 3.8.7.1-1+deb8u2 [377 kB] Get:2 http://archive.raspberrypi.org/debian/ jessie/main pigpio armhf 1.60-1 [196 kB] Get:3 http://archive.raspbian.org/raspbian/ jessie/main libpython2.7-minimal armhf 2.7.9-2+deb8u1 [376 kB] Get:4 http://archive.raspbian.org/raspbian/ jessie/main python2.7-minCreated symlink from /etc/systemd/system/multi-user.target.wants/pigpiod.service to /lib/systemd/system/pigpiod.service. Failed to get D-Bus connection: Unknown error -1 Reading package lists... Done Building dependency tree
Reading state information... Done The following extra packages will be installed: apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgdbm3 liblua5.1-0 libxml2 perl perl-modules Suggested packages: www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl make libb-lint-perl libcpanplus-dist-build-perl libcpanplus-perl libfile-checktree-perl liblog-message-simple-perl liblog-message-perl libobject-accessor-perl Recommended packages: ssl-cert xml-core rename libarchive-extract-perl libmodule-pluggable-perl libpod-latex-perl libterm-ui-perl libtext-soundex-perl libcgi-pm-perl libmodule-build-perl libpackage-constants-perl The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgdbm3 liblua5.1-0 libxml2 perl perl-modules 0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded. Need to get 7077 kB of archives. After this operation, 33.3 MB of additional disk space will be used. Get:1 http://archive.raspbian.org/raspbian/ jessie/main libgdbm3 armhf 1.8.3-13.1 [28.4 kB] Get:2 http://archive.raspbian.org/raspbian/ jessie/main libxml2 armhf 2.9.1+dfsg1-5+deb8u5 [707 kB] Get:3 http://archive.raspbian.org/raspbian/ jessie/main perl-modules all 5.20.2-3+deb8u9 [2553 kB] Get:4 http://archive.raspbian.org/raspbian/ jessie/main perl armhf 5.20.2-3+deb8u9 [2050 kB] Get:5 http://archive.raspbian.org/raspbian/ jessie/main libapr1 armhfAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message Your MPM seems to be threaded. Selecting cgid instead of cgi. Enabling module cgid. To activate the new configuration, you need to run: service apache2 restart Enabling conf crystal-signal. To activate the new configuration, you need to run: service apache2 reload Failed to get D-Bus connection: Unknown error -1 Reading package lists... Done Building dependency tree
Reading state information... Done Reading package lists... Done Building dependency tree
Reading package lists... Done Building dependency tree
Reading state information... Done The following extra packages will be installed: espeak-data libasound2 libasound2-data libasyncns0 libespeak1 libflac8 libice6 libjack-jackd2-0 libjson-c2 libogg0 libopus0 libportaudio2 libpulse0 libsamplerate0 libsm6 libsndfile1 libsonic0 libvorbis0a libvorbisenc2 libwrap0 libx11-6 libx11-data libx11-xcb1 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 x11-common Suggested packages: libasound2-plugins alsa-utils jackd2 opus-tools pulseaudio Recommended packages: tcpd The following NEW packages will be installed: espeak espeak-data libasound2 libasound2-data libasyncns0 libespeak1 libflac8 libice6 libjack-jackd2-0 libjson-c2 libogg0 libopus0 libportaudio2 libpulse0 libsamplerate0 libsm6 libsndfile1 libsonic0 libvorbis0a libvorbisenc2 libwrap0 libx11-6 libx11-data libx11-xcb1 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 x11-common 0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded. Need to get 5107 kB of archives. After this operation, 12.7 MB of additional disk space will be used. Get:1 http://archive.raspbian.org/raspbian/ jessie/main libwrap0 armhf 7.6.q-25 [55.5 kB] Get:2 http://archive.raspberrypi.org/debian/ jessie/main libasound2-data all 1.0.28-1+rpi3 [65.3 kB] Get:3 http://archive.raspbian.org/raspbian/ jessie/main libasyncns0 armhf 0.8-5 [11.4 kB] Get:4 http://archive.raspbian.org/raspbian/ jessie/main libopus0 armhf 1.1-2 [134 kB] Get:5 http://archive.raspberrypi.org/debian/ jessie/main libasound2 armhf 1.0.28-1+rpi3 [320 kB] Get:6 http://archive.raspbian.org/raspbian/ jessie/main libsamplerate0 armhf 0.1.8-8 [939 kB] Get:7 http://archive.raspbian.org/raspbian/ jessie/main libjack-jackd2-0 armhf 1.9.10+20140719git3eb0ae6a~dfsg-2 [148 kB] Get:8 http://archive.raspbian.org/raspbian/ jessie/main libportaudio2 armhf 19+svn20140130-1 [55.1 kB] Get:9 http://archive.raspbian.org/raspbian/ jessie/main libice6 armhf 2:1.0.9-1 [51.2 kB] Get:10 http://archive.raspbian.org/raspbian/ jessie/main libjson-c2 armhf 0.11-4 [22.7 kB] Get:11 http://archive.raspbian.org/raspbian/ jessie/main libsm6 armhf 2:1.2.2-1 [31.2 kB] Get:12 http://archive.raspbian.org/raspbian/ jessie/main libogg0 armhf 1.3.2-1 [17.2 kB] Get:13 http://archive.raspberrypi.org/debian/ jessie/main x11-common all 1:7.7+16 [251 kB] Get:14 http://archive.raspbian.org/raspbian/ jessie/main libflac8 armhf 1.3.0-3 [79.0 kB] Get:15 http://archive.raspbian.org/raspbian/ jessie/main libvorbis0a armhf 1.3.4-2 [82.7 kB] Get:16 http://archive.raspbian.org/raspbian/ jessie/main libvorbisenc2 armhf 1.3.4-2 [72.0 kB] Get:17 http://archive.raspbian.org/raspbian/ jessie/main libsndfile1 armhf 1.0.25-9.1+deb8u1 [204 kB] Get:18 http://archive.raspbian.org/raspbian/ jessie/main libxau6 armhf 1:1.0.8-1 [19.9 kB] Get:19 http://archive.raspbian.org/raspbian/ jessie/main libxdmcp6 armhf 1:1.1.1-1 [24.6 kB] Get:20 http://archive.raspbian.org/raspbian/ jessie/main libxcb1 armhf 1.10-3 [38.1 kB] Get:21 http://archive.raspbian.org/raspbian/ jessie/main libx11-data all 2:1.6.2-3+deb8u1 [126 kB] Get:22 http://archive.raspbian.org/raspbian/ jessie/main libx11-6 armhf 2:1.6.2-3+deb8u1 [664 kB] Get:23 http://archive.raspbian.org/raspbian/ jessie/main libx11-xcb1 install.sh: line 201: /usr/bin/wget: No such file or directory /bin/tar: /tmp/crystal-signal.tar.gz: Cannot open: No such file or directory /bin/tar: Error is not recoverable: exiting now /bin/chmod: cannot access ‘/tmp/crystal-signal-master/bin/*’: No such file or directory sending incremental file list rsync: change_dir "/tmp/crystal-signal-master/bin" failed: No such file or directory (2)

sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] /bin/cp: cannot stat ‘/tmp/crystal-signal-master/VERSION’: No such file or directory /bin/chmod: cannot access ‘/tmp/crystal-signal-master/scripts/*’: No such file or directory sending incremental file list rsync: change_dir "/tmp/crystal-signal-master/scripts" failed: No such file or directory (2)

sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] sending incremental file list rsync: change_dir "/tmp/crystal-signal-master/sounds" failed: No such file or directory (2)

sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] sending incremental file list rsync: change_dir "/tmp/crystal-signal-master/voice" failed: No such file or directory (2)

sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] sending incremental file list rsync: change_dir "/tmp/crystal-signal-master/html" failed: No such file or directory (2)

sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] /bin/chmod: cannot access ‘/var/www/html/ctrl/*.py’: No such file or directory install.sh: line 280: /usr/bin/wget: No such file or directory install.sh: line 289: /usr/bin/wget: No such file or directory install.sh: line 292: /usr/bin/wget: No such file or directory install.sh: line 297: /usr/bin/wget: No such file or directory install.sh: line 300: /usr/bin/wget: No such file or directory Created symlink from /etc/systemd/system/multi-user.target.wants/LEDController.service to /etc/systemd/system/LEDController.service. Failed to get D-Bus connection: Unknown error -1 FINISHED root@85667d734367:/usr/local/etc# ps ax PID TTY STAT TIME COMMAND 1 pts/0 Ss 0:00 /dev/init -- /usr/bin/entry.sh /bin/bash 7 pts/0 S 0:00 /bin/bash /usr/bin/entry.sh /bin/bash 12 pts/0 S 0:00 tini -sg -- /bin/bash 13 pts/0 S 0:00 /bin/bash 1754 pts/0 R+ 0:00 ps ax

apache2をリロードした後に「Failed to get D-Bus connection: Unknown error -1」とエラーが出ていますが、解決方法がまだ見つかりません。

Dockerの導入を期待しています。 よろしくお願いします。

T-Kuhn commented 6 years ago

Dockerの導入はまだ検討中です。