Raspberry PI docker容器未启动

时间:2017-05-21 16:13:05

标签: docker raspberry-pi

我使用命令./build.sh按照https://github.com/hypriot/rpi-node构建了docker镜像。

构建后可以看到图像:

REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hypriot/rpi-node               7.6.0-onbuild       3bc1143b2669        8 minutes ago       486MB
hypriot/rpi-node               7.6.0-slim          f0e665843753        8 minutes ago       201MB
hypriot/rpi-node               7.6.0               561d1c96f866        9 minutes ago       486MB
hypriot/rpi-node               6.10.0-onbuild      e914857026be        9 minutes ago       482MB
hypriot/rpi-node               6.10.0-slim         76f21b654bbb        9 minutes ago       197MB
hypriot/rpi-node               6.10.0              8358e50b084c        10 minutes ago      482MB
hypriot/rpi-node               4.8.0-onbuild       d7d1ed3d2745        11 minutes ago      477MB
hypriot/rpi-node               4.8.0-slim          fc4fcfe4dfe3        11 minutes ago      192MB
hypriot/rpi-node               4.8.0               0879c967512d        13 minutes ago      477MB

尝试使用6.10.0运行图像:sudo docker run hypriot/rpi-node:6.10.0不会返回任何输出,但容器未运行,因为执行docker ps会返回空响​​应。

如何启动rpi-node泊坞窗容器?

更新:

这似乎可以修复:sudo docker run -dti hypriot/rpi-node:6.10.0 tail -f /dev/null

来源:Docker container will automatically stop after "docker run -d"

2 个答案:

答案 0 :(得分:0)

根据https://github.com/hypriot/rpi-node/blob/master/6.10/Dockerfile#L94,图片似乎有CMD的默认node。只是运行图像会尝试执行node。这通常会运行Node.js REPL。但它需要一个互动终端。

尝试以sudo docker run -it hypriot/rpi-node:6.10.0运行,而不是设置交互模式和TTY。

答案 1 :(得分:0)

这似乎可以修复:// use P (+02:00), in stead of O (+0200), for easier splitting. $offset_parts = explode( ':', $time->format( 'P' ) ); $gmt_offset = floatval( $offset_parts[ 0 ] . '.' . ( ( $offset_parts[ 1 ] / 60 ) * 100 ) );