Sign inSign up

adibhanna/modbus-go

By adibhanna

•Updated 10 months ago
Archived

Modbus Implementation in Go

Image
Networking
Internet of things
0

172

adibhanna/modbus-go repository overview

⁠ModbusGo Docker Image

A production-ready MODBUS TCP server and client implementation in Go.

⁠Quick Start

# Run the MODBUS server
docker run -d -p 5502:5502 adibhanna/modbus-go:latest

# Or with standard MODBUS port
docker run -d -p 502:502 -p 5502:5502 adibhanna/modbus-go:latest

⁠Tags

TagDescription
latestLatest stable release
v1.1.0Version 1.1.0 - Go 1.25, Docker support
v1.0.0Version 1.0.0 - Initial release

⁠Features

  • Complete MODBUS Protocol - All 19 standard function codes
  • Multiple Transports - TCP, TLS, RTU over TCP, UDP
  • High-Level Data Types - Float32, Float64, Uint32, Uint64, strings
  • Configurable Endianness - Big/Little endian byte and word order
  • Production Ready - Auto-reconnect, graceful shutdown, thread-safe

⁠Exposed Ports

PortDescription
502Standard MODBUS TCP port
5502Alternative MODBUS TCP port

⁠Available Binaries

The image includes these pre-built binaries:

BinaryDescription
/app/bin/advanced_serverFull-featured MODBUS server (default)
/app/bin/tcp_serverSimple TCP server
/app/bin/tcp_clientTCP client example
/app/bin/integration_testIntegration test suite
/app/bin/config_showcaseConfiguration examples

⁠Usage Examples

⁠Run Advanced Server (Default)
docker run -d \
  --name modbus-server \
  -p 5502:5502 \
  adibhanna/modbus-go:latest
⁠Run Simple Server
docker run -d \
  --name modbus-simple \
  -p 5502:5502 \
  adibhanna/modbus-go:latest \
  /app/bin/tcp_server
⁠Run with Custom Configuration
docker run -d \
  --name modbus-server \
  -p 5502:5502 \
  -v /path/to/config.json:/app/config.json \
  adibhanna/modbus-go:latest
⁠Docker Compose
version: '3.8'
services:
  modbus-server:
    image: adibhanna/modbus-go:latest
    ports:
      - "5502:5502"
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "nc", "-z", "localhost", "5502"]
      interval: 30s
      timeout: 10s
      retries: 3

⁠Environment Variables

The container runs as non-root user modbus (UID 1000) for security.

⁠Health Check

The image includes a built-in health check:

nc -z localhost 5502

⁠Source Code

⁠License

MIT License - see LICENSE⁠

Tag summary

Content type

Image

Digest

sha256:dc60fe986…

Size

18.1 MB

Last updated

10 months ago

docker pull adibhanna/modbus-go