@magpern SPI access in Docker container is possible, you have to use --privileged switch when creating container and some other switches when compiling. I ended up with the following Dockerfile:
FROM raspbian/stretch AS build
WORKDIR /root
RUN apt-get update && apt-get install -y --no-install-recommends git bash make g++ \
&& git clone https://github.com/mysensors/MySensors.git --branch development
WORKDIR MySensors
RUN echo "##### Building version: $(cat library.properties | grep version | cut -d= -f2)-$(git describe --tags)"
RUN LDFLAGS="-static" ./configure --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-gateway=mqtt --my-controller-ip-address=<ip of the mqtt server> --my-mqtt-user=<user> --my-mqtt-password=<password> --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18 --my-config-file=/data/mysensors.conf --spi-driver=BCM --soc=BCM2836 --cpu-flags="-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -mtune=cortex-a53" \
&& make
FROM hypriot/rpi-alpine-scratch
RUN mkdir /data
WORKDIR /root
COPY --from=build /root/MySensors/bin/mysgw .
EXPOSE 5003
ENTRYPOINT ["./mysgw"]
I couldn't get ethernet mode to work (I got core dump as soon as client connected to gateway) so I'm using MQTT mode which works great. Here is the relevant run command:
docker run --privileged --volume /opt/mysensors:/data --restart unless-stopped --name mysgw zurajm/mysgw-mqtt-alpine:latest
the mysensors.conf resides in /opt/mysensors:
# Logging
# Verbosity: debug,info,notice,warn,err
verbose=debug
# Enable logging to a file.
log_file=0
# Log file path.
log_filepath=/tmp/mysgw.log
# Enable logging to a named pipe.
# Use this option to view your gateway's log messages
# from the log_pipe_file defined bellow.
# To do so, run the following command on another terminal:
# cat "log_pipe_file"
log_pipe=0
log_pipe_file=/tmp/mysgw.pipe
# Enable logging to syslog.
syslog=0
# EEPROM settings
eeprom_file=/data/mysensors.eeprom
eeprom_size=1024
# Software signing settings
# Note: The gateway must have been built with signing
# support to use the options below.
#
# To generate a HMAC key run mysgw with: --gen-soft-hmac-key
# copy the new key in the line below and uncomment it.
#soft_hmac_key=
# To generate a serial key run mysgw with: --gen-soft-serial-key
# copy the new key in the line below and uncomment it.
#soft_serial_key=
# Encryption settings
# Note: The gateway must have been built with encryption
# support to use the options below.
#
# To generate a AES key run mysgw with: --gen-aes-key
# copy the new key in the line below and uncomment it.
#aes_key=
I only modified eeprom_file location to /data folder.
I hope someone can benefit from it.
BR, Miha