我尝试在 docker 容器中运行 owfs 来解析 1-wire 温度值。跑步时
owfs -C -uall -m /mnt/1wire --allow_other
在容器内我收到此错误
Segmentation fault (core dumped)
在主机系统上,到目前为止,我可以毫无问题地运行相同的设置和命令:我不知道如何调试它以找到错误/解决方案,并希望得到提示/解决方案!
我的设置如下,Dockerfile:
FROM python:3.8-slim-buster
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y
COPY ds2490 /etc/modeprobe.d/ds2490
RUN apt-get install owfs -y
RUN apt-get install libtool automake libftdi-dev libusb-dev libusb-1.0.0-dev uthash-dev -y
RUN apt-get install usbutils -y
COPY owfs.conf /etc/owfs.conf
COPY fuse.conf /etc/fuse.conf
RUN mkdir /mnt/1wire
WORKDIR onewire
COPY ./docker_entrypoint.sh ./docker_entrypoint.sh
RUN chmod +x ./docker_entrypoint.sh
COPY ./parse_onewire.py ./parse_onewire.py
RUN chmod +x parse_onewire.py
ENTRYPOINT ./docker_entrypoint.sh
码头工人-compose.yml:
version: "3"
services:
onewire_parser:
container_name: 'onewire'
build: .
volumes:
- /dev/bus/usb:/dev/bus/usb
privileged: true
stdin_open: true
tty: true
restart: unless-stopped
ds2490:
blacklist ds2490
blacklist ds9490r
blacklist wire
fuse.conf:
#Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#
#mount_max = 1000
# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
#
user_allow_other
owfs.conf:
######################## SOURCES ########################
# With this setup, any client (but owserver) uses owserver on the
# local machine...
! server: server = localhost:4304
# ...and owserver uses the real hardware, by default fake devices
# This part must be changed on real installation
#server: FAKE = DS18S20,DS2405
# USB device: DS9490
server: usb = all
# Serial port: DS9097
#server: device = /dev/ttyS1
# owserver tcp address
#server: server = 192.168.10.1:3131
# random simulated device
#server: FAKE = DS18S20,DS2405
######################### OWFS ##########################
mountpoint = /mnt/1wire
allow_other
####################### OWHTTPD #########################
http: port = 2121
####################### OWFTPD ##########################
ftp: port = 2120
####################### OWSERVER ########################
server: port = localhost:4304
docker_entrypoint.sh:
#!/bin/bash
owfs -C -uall -m /mnt/1wire --allow_other