This Docker image facilitates the running of the Linux GPS daemon (gpsd) on a
Raspberry Pi, making it available as a network service. gpsd
is a daemon
that monitors one or more GPSes or AIS receivers attached to a host computer
through serial or USB ports.
Docker image: jfig/rpi-docker-gpsd
Github repo: https://github.com/jfig/rpi-docker-python-gpio
Ensure Docker is installed on your Raspberry Pi.
To use gpsd
, the GPS device's serial port needs to be mapped to the Docker
container. This is essential for gpsd
to communicate with the GPS device.
The default command to run the container is:
docker run --rm -it --device=/dev/ttyACM0:/dev/ttyUSB0 -p 2947:2947 gpsd
Here's what each parameter does:
--rm
: Automatically remove the container when it exits.
-it
: Interactive mode; allows you to interact with the container.
--device=/dev/ttyACM0:/dev/ttyUSB0
: Maps the GPS device from the host
(Raspberry Pi) to the container.
-p 2947:2947
: Exposes the gpsd port, allowing network access to the service.
version: '3'
services:
gpsd:
image: jfig/rpi-docker-gpsd
devices:
- "/dev/ttyACM0:/dev/ttyUSB0
ports:
- "2947:2947"
restart: always
gps-consumer:
image: your-gps-consumer-image # Replace with your actual GPS consumer Docker image
depends_on:
- gpsd
environment:
GPSD_HOST: gpsd
GPSD_PORT: 2947
restart: always