上QQ阅读APP看书,第一时间看更新
Running a simulator application on an RPi
To run a simulator application, follow the sequence of actions as described here:
- Open an SSH connection.
- Navigate to /home/pi/sensor.
- Build an image and run a Docker container:
# Build an image from a Dockerfile
docker build -t modbus-sensor .
#
# Run container in foreground
docker run -p 1502:1502 --privileged -it --rm --name modbus-sensor-container modbus-sensor
#
# Run container in background
# docker run -p 1502:1502 --privileged -d --rm --name modbus-sensor-container modbus-sensor
#
# Fetch the logs of a container
# docker logs -f modbus-sensor-container
#
# Stop running container
# docker stop modbus-sensor-container
Console output when a simulator app is running